public async Task <ActionResult> ValidateTwitterAuth() { var appClient = GetAppClient(); // RequestCredentialsParameters.FromCallbackUrl does 3 things: // * Extract the id from the callback // * Get the AuthenticationRequest from the store // * Remove the request from the store as it will no longer need it // This logic can be implemented manually if you wish change the behaviour var requestParameters = await RequestCredentialsParameters.FromCallbackUrl(Request.QueryString.Value, _myAuthRequestStore); var userCreds = await appClient.Auth.RequestCredentials(requestParameters); var userClient = new TwitterClient(userCreds); var user = await userClient.Users.GetAuthenticatedUser(); ViewBag.User = user; return(View()); }
public Task <ITwitterCredentials> RequestCredentialsFromCallbackUrlAsync(Uri callbackUri, IAuthenticationRequest authenticationRequest) { return(RequestCredentialsAsync(RequestCredentialsParameters.FromCallbackUrl(callbackUri, authenticationRequest))); }
public Task <ITwitterCredentials> RequestCredentialsFromCallbackUrl(string callbackUrl, IAuthenticationRequest authenticationRequest) { return(RequestCredentials(RequestCredentialsParameters.FromCallbackUrl(callbackUrl, authenticationRequest))); }