Interface IPkceAuthorizationCodeFlow
Authorization flow that supports Proof Key for Code Exchange (PKCE) as described in https://www.rfc-editor.org/rfc/rfc7636.
Inherited Members
Namespace: Google.Apis.Auth.OAuth2.Flows
Assembly: Google.Apis.Auth.dll
Syntax
public interface IPkceAuthorizationCodeFlow : IAuthorizationCodeFlow, IDisposable
Remarks
If you are writing your own authorization flow to be used with Authorization
Methods
CreateAuthorizationCodeRequest(string, out string)
Creates an authorization code request with the specified redirect URI.
Declaration
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 Authorization parameter.
|
Returns
Type | Description |
---|---|
Authorization |
An Authorization |
ExchangeCodeForTokenAsync(string, string, string, string, CancellationToken)
Asynchronously exchanges an authorization code for an access token.
Declaration
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 out parameter in an earlier call to CreateAuthorizationCodeRequest.
|
string | redirectUri | Redirect URI which is used in the token request. |
Cancellation |
taskCancellationToken | Cancellation token to cancel operation. |
Returns
Type | Description |
---|---|
Task<Token |
Token response which contains the access token. |