Show / Hide Table of Contents

Class PkceGoogleAuthorizationCodeFlow

Google authorization flow implementation that supports PKCE as described in https://www.rfc-editor.org/rfc/rfc7636 and https://developers.google.com/identity/protocols/oauth2/native-app.

Inheritance
object
AuthorizationCodeFlow
GoogleAuthorizationCodeFlow
PkceGoogleAuthorizationCodeFlow
Implements
IPkceAuthorizationCodeFlow
IAuthorizationCodeFlow
IDisposable
Inherited Members
GoogleAuthorizationCodeFlow.ProjectId
GoogleAuthorizationCodeFlow.RevokeTokenUrl
GoogleAuthorizationCodeFlow.includeGrantedScopes
GoogleAuthorizationCodeFlow.IncludeGrantedScopes
GoogleAuthorizationCodeFlow.LoginHint
GoogleAuthorizationCodeFlow.Prompt
GoogleAuthorizationCodeFlow.Nonce
GoogleAuthorizationCodeFlow.UserDefinedQueryParams
GoogleAuthorizationCodeFlow.CreateAuthorizationCodeRequest(string)
GoogleAuthorizationCodeFlow.RevokeTokenAsync(string, string, CancellationToken)
GoogleAuthorizationCodeFlow.ShouldForceTokenRetrieval()
AuthorizationCodeFlow.TokenServerUrl
AuthorizationCodeFlow.AuthorizationServerUrl
AuthorizationCodeFlow.ClientSecrets
AuthorizationCodeFlow.DataStore
AuthorizationCodeFlow.Scopes
AuthorizationCodeFlow.HttpClient
AuthorizationCodeFlow.AccessMethod
AuthorizationCodeFlow.Clock
AuthorizationCodeFlow.LoadTokenAsync(string, CancellationToken)
AuthorizationCodeFlow.DeleteTokenAsync(string, CancellationToken)
AuthorizationCodeFlow.ExchangeCodeForTokenAsync(string, string, string, CancellationToken)
AuthorizationCodeFlow.CreateAuthorizationCodeTokenRequest(string, string, string)
AuthorizationCodeFlow.ExchangeCodeForTokenAsync(string, AuthorizationCodeTokenRequest, CancellationToken)
AuthorizationCodeFlow.RefreshTokenAsync(string, string, CancellationToken)
AuthorizationCodeFlow.FetchTokenAsync(string, TokenRequest, CancellationToken)
AuthorizationCodeFlow.Dispose()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Auth.OAuth2.Flows
Assembly: Google.Apis.Auth.dll
Syntax
public class PkceGoogleAuthorizationCodeFlow : GoogleAuthorizationCodeFlow, IPkceAuthorizationCodeFlow, IAuthorizationCodeFlow, IDisposable

Constructors

PkceGoogleAuthorizationCodeFlow(Initializer)

Creates a new instance from the given initializer.

Declaration
public PkceGoogleAuthorizationCodeFlow(GoogleAuthorizationCodeFlow.Initializer initializer)
Parameters
Type Name Description
GoogleAuthorizationCodeFlow.Initializer initializer

Methods

CreateAuthorizationCodeRequest(string, out string)

Creates an authorization code request with the specified redirect URI.

Declaration
public AuthorizationCodeRequestUrl CreateAuthorizationCodeRequest(string redirectUri, out string codeVerifier)
Parameters
Type Name Description
string redirectUri

The redirect URI for the authorization code request.

string codeVerifier

The code verifier associated to the code challenge that should be included in the returned AuthorizationCodeRequestUrl. Note this is an

out
parameter.
Returns
Type Description
AuthorizationCodeRequestUrl

An AuthorizationCodeRequestUrl subclass instance that includes the code challenge and code challenge method associated with codeVerifier.

ExchangeCodeForTokenAsync(string, string, string, string, CancellationToken)

Asynchronously exchanges an authorization code for an access token.

Declaration
public Task<TokenResponse> ExchangeCodeForTokenAsync(string userId, string code, string codeVerifier, string redirectUri, CancellationToken taskCancellationToken)
Parameters
Type Name Description
string userId

User identifier.

string code

Authorization code received from the authorization server.

string codeVerifier

The PKCE code verifier to include in the exchange request. When called by the authentication library, this will be the same value specified by the

codeVerifier
out parameter in an earlier call to CreateAuthorizationCodeRequest.
string redirectUri

Redirect URI which is used in the token request.

CancellationToken taskCancellationToken

Cancellation token to cancel operation.

Returns
Type Description
Task<TokenResponse>

Token response which contains the access token.

Implements

IPkceAuthorizationCodeFlow
IAuthorizationCodeFlow
IDisposable
In this article
Back to top Generated by DocFX