The effective settings, for display.
A PUBLIC client (token_endpoint_auth_method "none").
OptionaldiscoveryCacheTtlMs?: numberHow long discovered metadata is cached (default 1h).
OptionalpostLogoutRedirectUri?: stringOptionalredirectUri?: stringOptionalresource?: string | string[]RFC 8707 resource indicator(s): audience-restricts the tokens.
Optionalscope?: stringDefault "openid profile email offline_access" (offline_access only if supported).
OptionaluserinfoSignedResponseAlg?: stringThe only alg a signed UserInfo response may use. Default: any asymmetric algorithm.
Which security features are active, for display and audit.
Completes the sign-in from the redirect: consumes the stored transaction for the returned state
(single use), checks it, redeems the code with the PKCE verifier (and a DPoP proof) and validates
the ID token.
The redirect URL, or its query parameters.
callback(), also answering the context the request was created with. An error the OP returned
(e.g. login_required or account_selection_required to a prompt=none request) is thrown as an
OAuthError carrying that context as err.context.
validateEndSessionCallback(), answering the context the logout request was created with.
Starts an Authorization Code + PKCE (S256) sign-in. The transaction (state, nonce, code verifier)
is stored in the transaction store under its state, and callback() consumes it.
Uses PAR when enabled, and binds the authorization code to the DPoP key (dpop_jkt).
Optionalopts: {OptionalacrValues?: stringSpace-separated; with enforceAcr, the ID token's acr must be one of these.
Optionalcontext?: anyJSON-serialisable data kept with the transaction and handed back by
completeAuthorization() (and on an OAuthError as err.context).
OptionalexpectedSub?: stringThe callback refuses an ID token about anybody else (account_mismatch):
when a request names an account, a sign-in as another person must not be taken for it.
OptionalextraParams?: Record<string, string>OptionalidTokenHint?: stringA previously issued ID token naming the account (and session) meant.
OptionalloginHint?: stringOptionalmaxAge?: numberOptionalprompt?: stringOptionalredirectUri?: stringOptionalscope?: stringBuilds an RP-Initiated Logout 1.0 request with a fresh state, stored for
validateEndSessionCallback(). Resolves undefined when the OP has no end_session_endpoint.
context is kept with the state and handed back by completeEndSession().
Optionalopts: {StaticdiscoverCreates a client and loads the provider's discovery document.
fetch() against a protected resource with an access token, retrying once when the resource server asks for a DPoP nonce (RFC 9449 §9).
Optionalinit: RequestInit = {}StaticfromCreates a client from an already-obtained OpenID Provider metadata document (validated as if discovered).
Refresh Token grant (OIDC Core §12). Keeps the previous refresh token when the OP doesn't rotate it, validates any new ID token against the previous claims (§12.2), and sends a DPoP proof with the same key when the tokens are DPoP-bound.
With a bare refresh token string there are no previous claims to hold a new ID token to, so pass
previousClaims (the claims of the ID token from the original sign-in); without them a response that
carries an ID token is refused.
Optionalopts: { previousClaims?: object; scope?: string } = {}StaticregisterRegisters a new PUBLIC client (OpenID Connect Dynamic Client Registration 1.0) and returns a client
configured from the registration. token_endpoint_auth_method is always "none".
RFC 7591 metadata, e.g. { redirect_uris, id_token_signed_response_alg }
Optionalconfig: Omit<OIDCClientConfig, "metadata" | "clientId"> & {The Authorization (and DPoP) headers for a request to a resource server with an access token. A DPoP-bound token (token_type "DPoP") gets a fresh proof bound to this method, URL and token.
authorization, and dpop for a DPoP-bound token
Token revocation (RFC 7009), as a public client. Resolves false when the OP has no revocation endpoint.
Optionalhint: "refresh_token" | "access_token"Calls the UserInfo endpoint (OIDC Core §5.3). The response must be about the person the ID token is
about (§5.3.2): its sub is checked against expectedSub, or else the TokenSet's ID token sub.
With a bare access token and no expectedSub there is nothing to check against, so it is refused.
Optionalopts: { expectedSub?: string } = {}Checks the state the OP returned to the post-logout redirect URI. Throws when it is missing,
unknown, reused or expired.
Optionalopts: {the validated claims
OpenID Connect Relying Party for a PUBLIC client (a browser app): Authorization Code + PKCE, with the protections RFC 9700 (OAuth 2.0 Security Best Current Practice) and OpenID Connect call for. It holds no client secret and supports no confidential-client authentication.
Emits: "tokens" (TokenSet) whenever the token endpoint issues new tokens.