C# Class CoreTweet.OAuth

显示文件 Open project: CoreTweet/CoreTweet

Public Methods

Method Description
Authorize ( string consumerKey, string consumerSecret, string oauthCallback = "oob", CoreTweet.ConnectionOptions options = null ) : OAuthSession

Generates the authorize URI.

Then call GetTokens after get the pin code.

AuthorizeAsync ( string consumerKey, string consumerSecret, string oauthCallback = "oob", CoreTweet.ConnectionOptions options = null, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Generates the authorize URI as an asynchronous operation.

Then call GetTokensAsync after get the pin code.

GetTokens ( this session, string oauthVerifier ) : Tokens

Gets the OAuth tokens.

Be sure to call Authorize before call this method.

GetTokensAsync ( this session, string pin, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Gets the OAuth tokens as an asynchronous operation.

Be sure to call AuthorizeAsync before call this method.

Private Methods

Method Description
GetAccessTokenUrl ( CoreTweet.ConnectionOptions options ) : Uri
GetRequestTokenUrl ( CoreTweet.ConnectionOptions options ) : Uri

Method Details

Authorize() public static method

Generates the authorize URI.

Then call GetTokens after get the pin code.

public static Authorize ( string consumerKey, string consumerSecret, string oauthCallback = "oob", CoreTweet.ConnectionOptions options = null ) : OAuthSession
consumerKey string The Consumer key.
consumerSecret string The Consumer secret.
oauthCallback string /// For OAuth 1.0a compliance this parameter is required. /// The value you specify here will be used as the URL a user is redirected to should they approve your application's access to their account. /// Set this to oob for out-of-band pin mode. /// This is also how you specify custom callbacks for use in desktop/mobile applications. /// Always send an oauth_callback on this step, regardless of a pre-registered callback. ///
options CoreTweet.ConnectionOptions The connection options for the request.
return OAuthSession

AuthorizeAsync() public static method

Generates the authorize URI as an asynchronous operation.

Then call GetTokensAsync after get the pin code.

public static AuthorizeAsync ( string consumerKey, string consumerSecret, string oauthCallback = "oob", CoreTweet.ConnectionOptions options = null, CancellationToken cancellationToken = default(CancellationToken) ) : Task
consumerKey string The consumer key.
consumerSecret string The consumer secret.
oauthCallback string /// For OAuth 1.0a compliance this parameter is required. /// The value you specify here will be used as the URL a user is redirected to should they approve your application's access to their account. /// Set this to oob for out-of-band pin mode. /// This is also how you specify custom callbacks for use in desktop/mobile applications. /// Always send an oauth_callback on this step, regardless of a pre-registered callback. ///
options CoreTweet.ConnectionOptions The connection options for the request.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetTokens() public static method

Gets the OAuth tokens.

Be sure to call Authorize before call this method.

public static GetTokens ( this session, string oauthVerifier ) : Tokens
session this The OAuth session.
oauthVerifier string The pin code.
return Tokens

GetTokensAsync() public static method

Gets the OAuth tokens as an asynchronous operation.

Be sure to call AuthorizeAsync before call this method.

public static GetTokensAsync ( this session, string pin, CancellationToken cancellationToken = default(CancellationToken) ) : Task
session this The OAuth session.
pin string The pin code.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task