Google API Client Library for .NET  1.10.0
Public Member Functions | Protected Member Functions | Static Protected Attributes | Properties | List of all members
Google.Apis.Auth.OAuth2.Mvc.Controllers.AuthCallbackController Class Reference

Auth callback to process the authorization code or error response from the authorization redirect page. More...

Inheritance diagram for Google.Apis.Auth.OAuth2.Mvc.Controllers.AuthCallbackController:

Public Member Functions

virtual async Task< ActionResult > IndexAsync (AuthorizationCodeResponseUrl authorizationCode, CancellationToken taskCancellationToken)
 The authorization callback which receives an authorization code which contains an error or a code. If a code is available the method exchange the coed with an access token and redirect back to the original page which initialized the auth process (using the state parameter). More...
 

Protected Member Functions

virtual ActionResult OnTokenError (TokenErrorResponse errorResponse)
 A callback which gets the error when this controller didn't receive an authorization code. The default implementation throws a Google.Apis.Auth.OAuth2.Responses.TokenResponseException. More...
 

Static Protected Attributes

static readonly ILogger Logger = ApplicationContext.Logger.ForType<AuthCallbackController>()
 

Properties

IAuthorizationCodeFlow Flow [get]
 Gets the authorization code flow. More...
 
string UserId [get]
 Gets the user identifier. Potential logic is to use session variables to retrieve that information. More...
 
abstract FlowMetadata FlowData [get]
 Gets the flow data which contains More...
 

Detailed Description

Auth callback to process the authorization code or error response from the authorization redirect page.

Member Function Documentation

virtual async Task<ActionResult> Google.Apis.Auth.OAuth2.Mvc.Controllers.AuthCallbackController.IndexAsync ( AuthorizationCodeResponseUrl  authorizationCode,
CancellationToken  taskCancellationToken 
)
inlinevirtual

The authorization callback which receives an authorization code which contains an error or a code. If a code is available the method exchange the coed with an access token and redirect back to the original page which initialized the auth process (using the state parameter).

The current timeout is set to 10 seconds. You can change the default behavior by setting System.Web.Mvc.AsyncTimeoutAttribute with a different value on your controller.

Parameters
authorizationCodeAuthorization code response which contains the code or an error.
taskCancellationTokenCancellation token to cancel operation.
Returns
Redirect action to the state parameter or OnTokenError in case of an error.
virtual ActionResult Google.Apis.Auth.OAuth2.Mvc.Controllers.AuthCallbackController.OnTokenError ( TokenErrorResponse  errorResponse)
inlineprotectedvirtual

A callback which gets the error when this controller didn't receive an authorization code. The default implementation throws a Google.Apis.Auth.OAuth2.Responses.TokenResponseException.

Property Documentation

IAuthorizationCodeFlow Google.Apis.Auth.OAuth2.Mvc.Controllers.AuthCallbackController.Flow
getprotected

Gets the authorization code flow.

abstract FlowMetadata Google.Apis.Auth.OAuth2.Mvc.Controllers.AuthCallbackController.FlowData
getprotected

Gets the flow data which contains

string Google.Apis.Auth.OAuth2.Mvc.Controllers.AuthCallbackController.UserId
getprotected

Gets the user identifier. Potential logic is to use session variables to retrieve that information.


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