コード例 #1
0
ファイル: HomeController.cs プロジェクト: anilerol/tweetinvi
        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());
        }
コード例 #2
0
 public Task <ITwitterCredentials> RequestCredentialsFromCallbackUrlAsync(Uri callbackUri, IAuthenticationRequest authenticationRequest)
 {
     return(RequestCredentialsAsync(RequestCredentialsParameters.FromCallbackUrl(callbackUri, authenticationRequest)));
 }
コード例 #3
0
ファイル: AuthClient.cs プロジェクト: anilerol/tweetinvi
 public Task <ITwitterCredentials> RequestCredentialsFromCallbackUrl(string callbackUrl, IAuthenticationRequest authenticationRequest)
 {
     return(RequestCredentials(RequestCredentialsParameters.FromCallbackUrl(callbackUrl, authenticationRequest)));
 }