DotNetOpenAuth.dll
OAuth
After this step user is redirected back to your website (http://www.yourdomain.com/oauth2callback). Following is this callback code. Its purpose is to get a refresh-token and an access-token: C# WebServerClient consumer= new WebServerClient(server, clientID, clientSecret); consumer.ClientCredentialApplicator = ClientCredentialApplicator.PostParameter(clientSecret); IAuthorizationState grantedAccess = consumer.ProcessUserAuthorization(null); string accessToken = grantedAccess.AccessToken; An access token is usually valid for a maximum of one hour, and allows you to access the user’s data. You also received a refresh token. A refresh token can be used to request a new access token once the previous expired.
WebServerClient consumer= new WebServerClient(server, clientID, clientSecret); consumer.ClientCredentialApplicator = ClientCredentialApplicator.PostParameter(clientSecret); IAuthorizationState grantedAccess = consumer.ProcessUserAuthorization(null); string accessToken = grantedAccess.AccessToken;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)