Google API Client Library for .NET  1.10.0
Classes | Public Member Functions | Public Attributes | Properties | List of all members
Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp Class Reference

Thread safe OAuth 2.0 authorization code flow for a web application that persists end-user credentials. More...

Inheritance diagram for Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp:
Google.Apis.Auth.OAuth2.Mvc.AuthorizationCodeMvcApp

Classes

class  AuthResult
 AuthResult which contains the user's credentials if it was loaded successfully from the store. Otherwise it contains the redirect URI for the authorization server. More...
 

Public Member Functions

 AuthorizationCodeWebApp (IAuthorizationCodeFlow flow, string redirectUri, string state)
 Constructs a new authorization code installed application with the given flow and code receiver. More...
 
async Task< AuthResultAuthorizeAsync (string userId, CancellationToken taskCancellationToken)
 Asynchronously authorizes the web application to access user's protected data. More...
 
bool ShouldRequestAuthorizationCode (TokenResponse token)
 Determines the need for retrieval of a new authorization code, based on the given token and the authorization code flow. More...
 

Public Attributes

const string StateKey = "oauth_"
 The state key. As part of making the request for authorization code we save the original request to verify that this server create the original request. More...
 
const int StateRandomLength = 8
 The length of the random number which will be added to the end of the state parameter. More...
 

Properties

IAuthorizationCodeFlow Flow [get]
 Gets the authorization code flow. More...
 
string RedirectUri [get]
 Gets the OAuth2 callback redirect URI. More...
 
string State [get]
 Gets the state which is used to navigate back to the page that started the OAuth flow. More...
 

Detailed Description

Thread safe OAuth 2.0 authorization code flow for a web application that persists end-user credentials.

Constructor & Destructor Documentation

Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.AuthorizationCodeWebApp ( IAuthorizationCodeFlow  flow,
string  redirectUri,
string  state 
)
inline

Constructs a new authorization code installed application with the given flow and code receiver.

Member Function Documentation

async Task<AuthResult> Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.AuthorizeAsync ( string  userId,
CancellationToken  taskCancellationToken 
)
inline

Asynchronously authorizes the web application to access user's protected data.

Parameters
userIdUser identifier
taskCancellationTokenCancellation token to cancel an operation
Returns
Auth result object which contains the user's credential or redirect URI for the authorization server
bool Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.ShouldRequestAuthorizationCode ( TokenResponse  token)
inline

Determines the need for retrieval of a new authorization code, based on the given token and the authorization code flow.

Member Data Documentation

const string Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.StateKey = "oauth_"

The state key. As part of making the request for authorization code we save the original request to verify that this server create the original request.

const int Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.StateRandomLength = 8

The length of the random number which will be added to the end of the state parameter.

Property Documentation

IAuthorizationCodeFlow Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.Flow
get

Gets the authorization code flow.

string Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.RedirectUri
get

Gets the OAuth2 callback redirect URI.

string Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.State
get

Gets the state which is used to navigate back to the page that started the OAuth flow.


The documentation for this class was generated from the following file: