C# Class Xamarin.Auth.OAuth2Authenticator.OAuth2Authenticator

Inheritance: WebRedirectAuthenticator
Mostra file Open project: nachocove/Xamarin.Auth

Private Properties

Property Type Description
OAuth2Authenticator System
RequestAccessTokenAsync string>>.Task

Public Methods

Method Description
GetInitialUrlAsync ( ) : Task

Method that returns the initial URL to be displayed in the web browser.

OAuth2Authenticator ( string clientId, string scope, Uri authorizeUrl, Uri redirectUrl, GetUsernameAsyncFunc getUsernameAsync = null ) : System

Initializes a new Xamarin.Auth.OAuth2Authenticator that authenticates using implicit granting (token).

OAuth2Authenticator ( string clientId, string clientSecret, string scope, Uri authorizeUrl, Uri redirectUrl, Uri accessTokenUrl, GetUsernameAsyncFunc getUsernameAsync = null ) : System

Initializes a new instance Xamarin.Auth.OAuth2Authenticator that authenticates using authorization codes (code).

Protected Methods

Method Description
OnPageEncountered ( Uri url, string>.IDictionary query, string>.IDictionary fragment ) : void

Raised when a new page has been loaded.

OnRedirectPageLoaded ( Uri url, string>.IDictionary query, string>.IDictionary fragment ) : void

Raised when a new page has been loaded.

OnRetrievedAccountProperties ( string>.IDictionary accountProperties ) : void

Event handler that is fired when an access token has been retreived.

RequestAccessTokenAsync ( string>.IDictionary queryValues ) : string>>.Task

Asynchronously makes a request to the access token URL with the given parameters.

Private Methods

Method Description
OAuth2Authenticator ( Uri redirectUrl, string clientSecret = null, Uri accessTokenUrl = null ) : System
RequestAccessTokenAsync ( string code ) : string>>.Task

Asynchronously requests an access token with an authorization code.

Implements: http://tools.ietf.org/html/rfc6749#section-4.1

Method Details

GetInitialUrlAsync() public method

Method that returns the initial URL to be displayed in the web browser.
public GetInitialUrlAsync ( ) : Task
return Task

OAuth2Authenticator() public method

Initializes a new Xamarin.Auth.OAuth2Authenticator that authenticates using implicit granting (token).
public OAuth2Authenticator ( string clientId, string scope, Uri authorizeUrl, Uri redirectUrl, GetUsernameAsyncFunc getUsernameAsync = null ) : System
clientId string /// Client identifier. ///
scope string /// Authorization scope. ///
authorizeUrl System.Uri /// Authorize URL. ///
redirectUrl System.Uri /// Redirect URL. ///
getUsernameAsync GetUsernameAsyncFunc /// Method used to fetch the username of an account /// after it has been successfully authenticated. ///
return System

OAuth2Authenticator() public method

Initializes a new instance Xamarin.Auth.OAuth2Authenticator that authenticates using authorization codes (code).
public OAuth2Authenticator ( string clientId, string clientSecret, string scope, Uri authorizeUrl, Uri redirectUrl, Uri accessTokenUrl, GetUsernameAsyncFunc getUsernameAsync = null ) : System
clientId string /// Client identifier. ///
clientSecret string /// Client secret. ///
scope string /// Authorization scope. ///
authorizeUrl System.Uri /// Authorize URL. ///
redirectUrl System.Uri /// Redirect URL. ///
accessTokenUrl System.Uri /// URL used to request access tokens after an authorization code was received. ///
getUsernameAsync GetUsernameAsyncFunc /// Method used to fetch the username of an account /// after it has been successfully authenticated. ///
return System

OnPageEncountered() protected method

Raised when a new page has been loaded.
protected OnPageEncountered ( Uri url, string>.IDictionary query, string>.IDictionary fragment ) : void
url System.Uri /// URL of the page. ///
query string>.IDictionary /// The parsed query of the URL. ///
fragment string>.IDictionary /// The parsed fragment of the URL. ///
return void

OnRedirectPageLoaded() protected method

Raised when a new page has been loaded.
protected OnRedirectPageLoaded ( Uri url, string>.IDictionary query, string>.IDictionary fragment ) : void
url System.Uri /// URL of the page. ///
query string>.IDictionary /// The parsed query string of the URL. ///
fragment string>.IDictionary /// The parsed fragment of the URL. ///
return void

OnRetrievedAccountProperties() protected method

Event handler that is fired when an access token has been retreived.
protected OnRetrievedAccountProperties ( string>.IDictionary accountProperties ) : void
accountProperties string>.IDictionary /// The retrieved account properties ///
return void

RequestAccessTokenAsync() protected method

Asynchronously makes a request to the access token URL with the given parameters.
protected RequestAccessTokenAsync ( string>.IDictionary queryValues ) : string>>.Task
queryValues string>.IDictionary The parameters to make the request with.
return string>>.Task