public async Task<ActionResult> GetRefreshToken(string refreshToken) { var auth = new AuthenticationClient(); await auth.TokenRefreshAsync(_consumerKey, refreshToken, _consumerSecret); ViewBag.Token = auth.AccessToken; ViewBag.ApiVersion = auth.ApiVersion; ViewBag.InstanceUrl = auth.InstanceUrl; ViewBag.RefreshToken = auth.RefreshToken; ViewBag.LoggedIn = true; return View("Index"); }
private async void btnRefreshToken_Click(object sender, RoutedEventArgs e) { try { var auth = new AuthenticationClient(); await auth.TokenRefreshAsync(ConsumerKey, _token.RefreshToken); var message = string.Format("Token Refresh Successful:\n\nAccess Token: {0}\n\nInstance URL: {1}", auth.AccessToken, auth.InstanceUrl); lblOutput.Text = message; } catch (ForceException ex) { lblOutput.Text = ex.Message; } }