Optional
session: SessionOptional
openId: OpenIdConfigurationProtected
Optional
_openOptional
Readonly
authorizationThe authorization endpoint is used to interact with the resource owner and obtain an authorization grant. The authorization server MUST first verify the identity of the resource owner. Source: https://www.rfc-editor.org/rfc/rfc6749#section-3.1
Readonly
clientThe client identifier issued to the client during the registration process.
Protected
Readonly
clientThe client secret issued by the OAuth provider. Some credential providers do not require a client secret.
Readonly
discoveryA fully qualified URL for the OpenId Provider Metadata.
Source: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
Optional
Readonly
endURL at the OP to which an RP can perform a redirect to request that the End-User be logged out at the OP. This URL MUST use the https scheme and MAY contain port, path, and query parameter components. SOURCE: https://openid.net/specs/openid-connect-rpinitiated-1_0.html#OPMetadata
Readonly
maxReadonly
maxReadonly
postThe redirection endpoint that the authorization server should redirect to after unauthenticating the resource owner.
Readonly
redirectThe redirection endpoint that the authorization server should redirect to after authenticating the resource owner.
Source: https://www.rfc-editor.org/rfc/rfc6749#section-3.1.2
Readonly
scopeThe scope to request during the authorization flow. As defined per the OAuth Specification: "...a list of space-delimited, case-sensitive strings. The strings are defined by the authorization server. If the value contains multiple space-delimited strings, their order does not matter, and each string adds an additional access range to the requested scope." Source: https://www.rfc-editor.org/rfc/rfc6749#section-3.3.
Readonly
sessionOptional
Readonly
tokenThe token endpoint is used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (deprecated) since an access token is issued directly. Source: https://www.rfc-editor.org/rfc/rfc6749#section-3.2
Optional
Readonly
tokenSpecifies the authentication method to be used at the OAuth 2.0 token endpoint.
This property indicates how the client credentials should be transmitted when exchanging an authorization code for an access token. The value can be one of the following:
TOKEN_ENDPOINT_AUTH_METHOD.BASIC
: Client credentials are included in the HTTP Authorization
header using Basic authentication (base64 encoded clientId:clientSecret
).TOKEN_ENDPOINT_AUTH_METHOD.POST
: Client credentials are sent as form parameters in the request body.If this property is undefined, the authentication method defaults to TOKEN_ENDPOINT_AUTH_METHOD.POST
.
Readonly
tokenThe location where the token should be used.
Readonly
tokenThe name of the token location property, usually a header name or querystring key.
Readonly
tokenThe token value may have a prefix, such as 'Basic' or 'Bearer'
Protected
createCreates the configuration object for an OAuth2 token request.
This function returns a RequestInit object that can be used with the fetch API to perform a token request. It builds the request using a POST method and the application/x-www-form-urlencoded content type. Depending on the authentication method (BASIC or POST) and the grant type (AUTHORIZATION_CODE or REFRESH_TOKEN), the appropriate headers and body parameters are conditionally included.
The options for the token request.
The request configuration object, including method, headers, and body.
Retrieves an access token in the final step of the authorization code flow.
Note The consumer should redirect the user-agent to the authorization endpoint which can be obtained using the AuthorizationCodeProvider.prototype.getAuthorizationUri method.
Parameters to configure the access token request.
An active access token.
Parse the queries from the authorization redirect
The authorization redirect url.
Optional
state: stringIf provided, the state from the redirect url will be matched against this state to ensure sameness.
A parsed authorization code.
Formats the authorization URI with the properly formatted, url-encoded parameters.
Optional
options: AuthorizationCodeRedirectOptionsParameters used to format the authorization URI.
Return the URI that the user-agent should open to initiate the authorization code flow.
Protected
getRetrieves the token endpoint URL for the OpenID provider. It first checks if the tokenEndpoint
property is already set and returns it if available. If not, it retrieves the OpenID configuration
via the openId()
method, obtains the token endpoint from the configuration, and converts it to a string.
A promise that resolves to the token endpoint URL as a string.
Get an access token using the authorization code.
The parsed authorization code from the authorization redirect url.
Optional
codeVerifier: stringA cryptographically unique string to use to verify the client is the only entity able to trade
the authorization code for an access token. Use the genCodeVerifier
method to securely generate a code verifier.
An active access token.
Parses the authorization code response received from the authorization server after authenticating the resource owner.
The URL that the authorization server redirected the user-agent to after authenticating the resource-owner.
Optional
options: AuthorizationCodeRedirectOptionsParameters to configure the access token request and verify the state of the client.
An active access token.
Retrieves the user information associated with the access token. To do this, it first looks up the user info endpoint in the open id configuration document.
The access token to be introspected
Optional
tokenTypeHint: stringThe
Refreshes the access token.
the expired access token object.
This function should only be implemented when extending this class
Static
fromOptional
session: SessionOptional
openId: OpenIdConfigurationStatic
fromOptional
prefix: string
OpenID Provider metadata used to configure clients. Docs: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata