class AuthorizationCodeGrant
extends OAuth2GrantBase
import { AuthorizationCodeGrant } from "https://deno.land/x/oauth2_client@v0.3.0/src/authorization_code_grant.ts";
Implements the OAuth 2.0 authorization code grant.
Constructors
new
AuthorizationCodeGrant(client: OAuth2Client)Methods
private
buildAccessTokenRequest(code: string, requestOptions?: RequestOptions): Requestprivate
validateAuthorizationResponse(url: URL, options: GetTokenOptions): { code: string; state?: string; }getAuthorizationUri(options?: GetUriOptions): URL
Builds a URI you can redirect a user to to make the authorization request.
getToken(authResponseUri: string | URL, options?: GetTokenOptions): Promise<Tokens>
Parses the authorization response request tokens from the authorization server.
Usually you'd want to call this method in the function that handles the user's request to your configured redirectUri.