Abstract
Protected
constructorThe credential provider configuration options.
Optional
openId: OpenIdConfigurationAn Open ID configuration used to configure this credential provider.
Protected
Optional
_openOpenID Provider metadata used to configure clients. Docs: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
Optional
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
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.
Optional
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'
Abstract
cloneOptional
options: unknownProtected
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.
Abstract
expireAbstract
getThis function should only be implemented when extending this class
Rest
...args: unknown[]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.
Abstract
resolveThis function should only be implemented when extending this class
Static
fromOptional
_data: unknownStatic
fromOptional
_prefix: string
Constructs the base of the credential providers. Only use this class to inherit the base methods and properties.