public ExpireRequestTokenAndStoreNewAccessToken ( string consumerKey, string requestToken, string accessToken, string accessTokenSecret ) : void | ||
consumerKey | string | The Consumer that is exchanging its request token for an access token. |
requestToken | string | The Consumer's request token that should be deleted/expired. |
accessToken | string | The new access token that is being issued to the Consumer. |
accessTokenSecret | string | The secret associated with the newly issued access token. |
Результат | void |
/// <summary> /// Creates a 23 API service repository, that doesn't require further authentication. Account must be "privileged" /// </summary> /// <param name="consumerDomain">Domain name</param> /// <param name="consumerKey">Consumer key</param> /// <param name="consumerSecret">Consumer secret</param> /// <param name="accessToken">Access token</param> /// <param name="accessTokenSecret">Access token secret</param> public ApiProvider(string consumerDomain, string consumerKey, string consumerSecret, string accessToken, string accessTokenSecret, bool httpSecure) { // Save the authentication keys _consumerDomain = consumerDomain; _consumerKey = consumerKey; _consumerSecret = consumerSecret; _httpSecure = httpSecure; string protocol = httpSecure ? "https://" : "http://"; // Adjust timeout for requests to the domain to allow for large file uploads WebRequest.RegisterPrefix(protocol + _consumerDomain, TwentyThreeCreatorRequestCreator.TwentyThreeHttp); // Open the OAuth consumer connection _oAuthProviderDescription.AccessTokenEndpoint = new MessageReceivingEndpoint(protocol + "api.visualplatform.net/oauth/access_token", HttpDeliveryMethods.GetRequest); _oAuthProviderDescription.RequestTokenEndpoint = new MessageReceivingEndpoint(protocol + "api.visualplatform.net/oauth/request_token", HttpDeliveryMethods.GetRequest); _oAuthProviderDescription.ProtocolVersion = ProtocolVersion.V10a; _oAuthProviderDescription.UserAuthorizationEndpoint = new MessageReceivingEndpoint(protocol + "api.visualplatform.net/oauth/authorize", HttpDeliveryMethods.GetRequest); _oAuthProviderDescription.TamperProtectionElements = new ITamperProtectionChannelBindingElement[] { new HmacSha1SigningBindingElement() }; _oAuthTokenManager = new InMemoryTokenManager(_consumerKey, _consumerSecret); _oAuthConsumer = new WebConsumer(_oAuthProviderDescription, _oAuthTokenManager); if (accessToken != null) { _accessToken = accessToken; _accessTokenSecret = accessTokenSecret; _oAuthTokenManager.ExpireRequestTokenAndStoreNewAccessToken(_consumerKey, "", _accessToken, _accessTokenSecret); } _oAuthConsumer.Channel.AssertBoundary(); }
/// <summary> /// Creates a 23 API service repository, that doesn't require further authentication. Account must be "privileged" /// </summary> /// <param name="consumerDomain">Domain name</param> /// <param name="consumerKey">Consumer key</param> /// <param name="consumerSecret">Consumer secret</param> /// <param name="accessToken">Access token</param> /// <param name="accessTokenSecret">Access token secret</param> public ApiProvider(string consumerDomain, string consumerKey, string consumerSecret, string accessToken, string accessTokenSecret) { // Save the authentication keys _consumerDomain = consumerDomain; _consumerKey = consumerKey; _consumerSecret = consumerSecret; // Open the OAuth consumer connection _oAuthProviderDescription.AccessTokenEndpoint = new MessageReceivingEndpoint("http://api.visualplatform.net/oauth/access_token", HttpDeliveryMethods.GetRequest); _oAuthProviderDescription.RequestTokenEndpoint = new MessageReceivingEndpoint("http://api.visualplatform.net/oauth/request_token", HttpDeliveryMethods.GetRequest); _oAuthProviderDescription.ProtocolVersion = ProtocolVersion.V10a; _oAuthProviderDescription.UserAuthorizationEndpoint = new MessageReceivingEndpoint("http://api.visualplatform.net/oauth/authorize", HttpDeliveryMethods.GetRequest); _oAuthProviderDescription.TamperProtectionElements = new ITamperProtectionChannelBindingElement[] { new HmacSha1SigningBindingElement() }; _oAuthTokenManager = new InMemoryTokenManager(_consumerKey, _consumerSecret); _oAuthConsumer = new WebConsumer(_oAuthProviderDescription, _oAuthTokenManager); if (accessToken != null) { _accessToken = accessToken; _accessTokenSecret = accessTokenSecret; _oAuthTokenManager.ExpireRequestTokenAndStoreNewAccessToken(_consumerKey, "", _accessToken, _accessTokenSecret); } _oAuthConsumer.Channel.AssertBoundary(); }