Google API Client Library for .NET  1.10.0
Public Member Functions | Properties | List of all members
Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow Interface Reference

OAuth 2.0 authorization code flow that manages and persists end-user credentials. More...

Inheritance diagram for Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow:
Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow Google.Apis.Auth.OAuth2.Flows.GoogleAuthorizationCodeFlow

Public Member Functions

Task< TokenResponseLoadTokenAsync (string userId, CancellationToken taskCancellationToken)
 Asynchronously loads the user's token using the flow's Google.Apis.Util.Store.IDataStore. More...
 
Task DeleteTokenAsync (string userId, CancellationToken taskCancellationToken)
 Asynchronously deletes the user's token using the flow's Google.Apis.Util.Store.IDataStore. More...
 
AuthorizationCodeRequestUrl CreateAuthorizationCodeRequest (string redirectUri)
 Creates an authorization code request with the specified redirect URI. More...
 
Task< TokenResponseExchangeCodeForTokenAsync (string userId, string code, string redirectUri, CancellationToken taskCancellationToken)
 Asynchronously exchanges code with a token. More...
 
Task< TokenResponseRefreshTokenAsync (string userId, string refreshToken, CancellationToken taskCancellationToken)
 Asynchronously refreshes an access token using a refresh token. More...
 
Task RevokeTokenAsync (string userId, string token, CancellationToken taskCancellationToken)
 Asynchronously revokes the specified token. This method disconnects the user's account from the OAuth 2.0 application. It should be called upon removing the user account from the site. More...
 
bool ShouldForceTokenRetrieval ()
 Indicates if a new token needs to be retrieved and stored regardless of normal circumstances. More...
 

Properties

IAccessMethod AccessMethod [get]
 Gets the method for presenting the access token to the resource server. More...
 
IClock Clock [get]
 Gets the clock. More...
 
IDataStore DataStore [get]
 Gets the data store used to store the credentials. More...
 

Detailed Description

OAuth 2.0 authorization code flow that manages and persists end-user credentials.

Member Function Documentation

AuthorizationCodeRequestUrl Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.CreateAuthorizationCodeRequest ( string  redirectUri)

Creates an authorization code request with the specified redirect URI.

Implemented in Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow, and Google.Apis.Auth.OAuth2.Flows.GoogleAuthorizationCodeFlow.

Task Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.DeleteTokenAsync ( string  userId,
CancellationToken  taskCancellationToken 
)

Asynchronously deletes the user's token using the flow's Google.Apis.Util.Store.IDataStore.

Parameters
userIdUser identifier.
taskCancellationTokenCancellation token to cancel operation.

Implemented in Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.

Task<TokenResponse> Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.ExchangeCodeForTokenAsync ( string  userId,
string  code,
string  redirectUri,
CancellationToken  taskCancellationToken 
)

Asynchronously exchanges code with a token.

Parameters
userIdUser identifier.
codeAuthorization code received from the authorization server.
redirectUriRedirect URI which is used in the token request.
taskCancellationTokenCancellation token to cancel operation.
Returns
Token response which contains the access token.

Implemented in Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.

Task<TokenResponse> Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.LoadTokenAsync ( string  userId,
CancellationToken  taskCancellationToken 
)

Asynchronously loads the user's token using the flow's Google.Apis.Util.Store.IDataStore.

Parameters
userIdUser identifier
taskCancellationTokenCancellation token to cancel operation
Returns
Token response

Implemented in Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.

Task<TokenResponse> Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.RefreshTokenAsync ( string  userId,
string  refreshToken,
CancellationToken  taskCancellationToken 
)

Asynchronously refreshes an access token using a refresh token.

Parameters
userIdUser identifier.
refreshTokenRefresh token which is used to get a new access token.
taskCancellationTokenCancellation token to cancel operation.
Returns
Token response which contains the access token and the input refresh token.

Implemented in Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.

Task Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.RevokeTokenAsync ( string  userId,
string  token,
CancellationToken  taskCancellationToken 
)

Asynchronously revokes the specified token. This method disconnects the user's account from the OAuth 2.0 application. It should be called upon removing the user account from the site.

If revoking the token succeeds, the user's credential is removed from the data store and the user MUST authorize the application again before the application can access the user's private resources.

Parameters
userIdUser identifier.
tokenAccess token to be revoked.
taskCancellationTokenCancellation token to cancel operation.
Returns
true if the token was revoked successfully.

Implemented in Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow, and Google.Apis.Auth.OAuth2.Flows.GoogleAuthorizationCodeFlow.

bool Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.ShouldForceTokenRetrieval ( )

Indicates if a new token needs to be retrieved and stored regardless of normal circumstances.

Implemented in Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow, and Google.Apis.Auth.OAuth2.Flows.GoogleAuthorizationCodeFlow.

Property Documentation

IAccessMethod Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.AccessMethod
get

Gets the method for presenting the access token to the resource server.

IClock Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.Clock
get

Gets the clock.

IDataStore Google.Apis.Auth.OAuth2.Flows.IAuthorizationCodeFlow.DataStore
get

Gets the data store used to store the credentials.


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