Google API Client Library for .NET  1.10.0
Public Member Functions | Properties | List of all members
Google.Apis.Auth.OAuth2.Mvc.AuthorizationCodeMvcApp Class Reference

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

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

Public Member Functions

 AuthorizationCodeMvcApp (Controller controller, FlowMetadata flowData)
 Constructs a new authorization code MVC app using the given controller and flow data. More...
 
Task< AuthResultAuthorizeAsync (CancellationToken taskCancellationToken)
 Asynchronously authorizes the installed application to access user's protected data. It gets the user identifier by calling to Google.Apis.Auth.OAuth2.Mvc.FlowMetadata.GetUserId and then calls to Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.AuthorizeAsync. More...
 
- Public Member Functions inherited from Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp
 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...
 

Properties

Controller Controller [get]
 Gets the controller which is the owner of this authorization code MVC app instance. More...
 
FlowMetadata FlowData [get]
 Gets the Google.Apis.Auth.OAuth2.Mvc.FlowMetadata object. More...
 
- Properties inherited from Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp
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...
 

Additional Inherited Members

- Public Attributes inherited from Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp
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...
 

Detailed Description

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

Constructor & Destructor Documentation

Google.Apis.Auth.OAuth2.Mvc.AuthorizationCodeMvcApp.AuthorizationCodeMvcApp ( Controller  controller,
FlowMetadata  flowData 
)
inline

Constructs a new authorization code MVC app using the given controller and flow data.

Member Function Documentation

Task<AuthResult> Google.Apis.Auth.OAuth2.Mvc.AuthorizationCodeMvcApp.AuthorizeAsync ( CancellationToken  taskCancellationToken)
inline

Asynchronously authorizes the installed application to access user's protected data. It gets the user identifier by calling to Google.Apis.Auth.OAuth2.Mvc.FlowMetadata.GetUserId and then calls to Google.Apis.Auth.OAuth2.Web.AuthorizationCodeWebApp.AuthorizeAsync.

Parameters
taskCancellationTokenCancellation token to cancel an operation
Returns
Auth result object which contains the user's credential or redirect URI for the authorization server

Property Documentation

Controller Google.Apis.Auth.OAuth2.Mvc.AuthorizationCodeMvcApp.Controller
get

Gets the controller which is the owner of this authorization code MVC app instance.

FlowMetadata Google.Apis.Auth.OAuth2.Mvc.AuthorizationCodeMvcApp.FlowData
get

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