C# Class SimpleAuth.OAuthApi

Inheritance: Api
Show file Open project: Clancey/SimpleAuth Class Usage Examples

Protected Properties

Property Type Description
authenticator WebAuthenticator

Public Methods

Method Description
OAuthApi ( string identifier, OAuthAuthenticator authenticator, HttpMessageHandler handler = null ) : System

Initializes a new instance of the T:SimpleAuth.OAuthApi class.

OAuthApi ( string identifier, string clientId, string clientSecret, string tokenUrl, string authorizationUrl, string redirectUrl = "http://localhost", HttpMessageHandler handler = null ) : System

Initializes a new instance of the T:SimpleAuth.OAuthApi class.

PrepareClient ( HttpClient client ) : System.Threading.Tasks.Task
ResetData ( ) : void

Protected Methods

Method Description
CreateAuthenticator ( ) : WebAuthenticator
GetAccountFromAuthCode ( WebAuthenticator authenticator, string identifier ) : Task
OAuthApi ( string identifier, string clientId, string clientSecret, HttpMessageHandler handler = null ) : System
PerformAuthenticate ( ) : Task
RefreshAccount ( Account account ) : Task
RefreshToken ( Account accaccount ) : Task

Private Methods

Method Description
OAuthApi ( ) : System

Method Details

CreateAuthenticator() protected method

protected CreateAuthenticator ( ) : WebAuthenticator
return WebAuthenticator

GetAccountFromAuthCode() protected method

protected GetAccountFromAuthCode ( WebAuthenticator authenticator, string identifier ) : Task
authenticator WebAuthenticator
identifier string
return Task

OAuthApi() public method

Initializes a new instance of the T:SimpleAuth.OAuthApi class.
public OAuthApi ( string identifier, OAuthAuthenticator authenticator, HttpMessageHandler handler = null ) : System
identifier string This is used to store and look up credentials/cookies for the API
authenticator OAuthAuthenticator OAuth Authenticator.
handler System.Net.Http.HttpMessageHandler Handler.
return System

OAuthApi() protected method

protected OAuthApi ( string identifier, string clientId, string clientSecret, HttpMessageHandler handler = null ) : System
identifier string
clientId string
clientSecret string
handler System.Net.Http.HttpMessageHandler
return System

OAuthApi() public method

Initializes a new instance of the T:SimpleAuth.OAuthApi class.
public OAuthApi ( string identifier, string clientId, string clientSecret, string tokenUrl, string authorizationUrl, string redirectUrl = "http://localhost", HttpMessageHandler handler = null ) : System
identifier string This is used to store and look up credentials/cookies for the API
clientId string OAuth Client identifier.
clientSecret string OAuth Client secret.
tokenUrl string URL for swaping out the token.
authorizationUrl string Login website URL.
redirectUrl string Redirect URL. Defaults to http://localhost
handler System.Net.Http.HttpMessageHandler Handler.
return System

PerformAuthenticate() protected method

protected PerformAuthenticate ( ) : Task
return Task

PrepareClient() public method

public PrepareClient ( HttpClient client ) : System.Threading.Tasks.Task
client System.Net.Http.HttpClient
return System.Threading.Tasks.Task

RefreshAccount() protected method

protected RefreshAccount ( Account account ) : Task
account Account
return Task

RefreshToken() protected method

protected RefreshToken ( Account accaccount ) : Task
accaccount Account
return Task

ResetData() public method

public ResetData ( ) : void
return void

Property Details

authenticator protected property

protected WebAuthenticator,SimpleAuth authenticator
return WebAuthenticator