Interface OAuth2StrategyOptions

interface OAuth2StrategyOptions {
    authenticateWith?: "http_basic_auth" | "request_body";
    authorizationEndpoint: string | URL;
    clientId: string;
    clientSecret: string;
    codeChallengeMethod?: "S256" | "plain";
    redirectURI: string | URL;
    scopes?: string[];
    tokenEndpoint: string | URL;
    tokenRevocationEndpoint?: string | URL;
}

Properties

authenticateWith?: "http_basic_auth" | "request_body"

The method to use to authenticate with the Identity Provider, this can be either http_basic_auth or request_body.

"request_body"
authorizationEndpoint: string | URL

The endpoint the Identity Provider asks you to send users to log in, or authorize your application.

clientId: string

This is the Client ID of your application, provided to you by the Identity Provider you're using to authenticate users.

clientSecret: string

This is the Client Secret of your application, provided to you by the Identity Provider you're using to authenticate users.

codeChallengeMethod?: "S256" | "plain"

The code challenge method to use when sending the authorization request. This is used when the Identity Provider requires a code challenge to be sent with the authorization request.

"S256"
redirectURI: string | URL

The URL of your application where the Identity Provider will redirect the user after they've logged in or authorized your application.

scopes?: string[]

The scopes you want to request from the Identity Provider, this is a list of strings that represent the permissions you want to request from the user.

tokenEndpoint: string | URL

The endpoint the Identity Provider uses to let's you exchange an access code for an access and refresh token.

tokenRevocationEndpoint?: string | URL

The endpoint the Identity Provider uses to revoke an access or refresh token, this can be useful to log out the user.