public class PkceGoogleAuthorizationCodeFlow : GoogleAuthorizationCodeFlow, IPkceAuthorizationCodeFlow, IAuthorizationCodeFlow, IDisposableGoogle 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 > PkceGoogleAuthorizationCodeFlowNamespace
Google.Apis.Auth.OAuth2.FlowsAssembly
Google.Apis.Auth.dll
Constructors
PkceGoogleAuthorizationCodeFlow(Initializer)
public PkceGoogleAuthorizationCodeFlow(GoogleAuthorizationCodeFlow.Initializer initializer)Creates a new instance from the given initializer.
| Parameter | |
|---|---|
| Name | Description |
initializer |
GoogleAuthorizationCodeFlowInitializer |
Methods
CreateAuthorizationCodeRequest(string, out string)
public AuthorizationCodeRequestUrl CreateAuthorizationCodeRequest(string redirectUri, out string codeVerifier)Creates an authorization code request with the specified redirect URI.
| Parameters | |
|---|---|
| Name | Description |
redirectUri |
stringThe redirect URI for the authorization code request. |
codeVerifier |
stringThe code verifier associated to the code challenge that should be included in the returned AuthorizationCodeRequestUrl. Note this is an |
| Returns | |
|---|---|
| Type | Description |
AuthorizationCodeRequestUrl |
An AuthorizationCodeRequestUrl subclass instance that includes the code challenge
and code challenge method associated with |
ExchangeCodeForTokenAsync(string, string, string, string, CancellationToken)
public Task<TokenResponse> ExchangeCodeForTokenAsync(string userId, string code, string codeVerifier, string redirectUri, CancellationToken taskCancellationToken)Asynchronously exchanges an authorization code for an access token.
| Parameters | |
|---|---|
| Name | Description |
userId |
stringUser identifier. |
code |
stringAuthorization code received from the authorization server. |
codeVerifier |
stringThe PKCE code verifier to include in the exchange request. When called by the authentication library, this will be the same value specified by the |
redirectUri |
stringRedirect URI which is used in the token request. |
taskCancellationToken |
CancellationTokenCancellation token to cancel operation. |
| Returns | |
|---|---|
| Type | Description |
TaskTokenResponse |
Token response which contains the access token. |