Extended by
Implements
OAuthClientProvider
Constructors
Constructor
Parameters
options?
OAuthOptions = {}
Returns
OAuth
Properties
_callbackPromise
_callbackReject
_callbackResolve
clientMetadataUrl?
Implementation of
Accessors
callbackServerPort
Get Signature
Returns
number | null
clientMetadata
Get Signature
Returns
Implementation of
redirectUrl
Get Signature
undefined for non-interactive flows that don’t require user interaction
(e.g., client_credentials, jwt-bearer).
Returns
string | URL
Implementation of
Methods
_armCallbackPromise()
Returns
void
_awaitCallback()
Parameters
timeoutMs
number
Returns
Promise<URLSearchParams>
_bind()
Parameters
serverUrl
string
Returns
void
_rejectCallback()
Parameters
err
Error
Returns
void
_resolveCallback()
Parameters
params
URLSearchParams
Returns
void
clientInformation()
undefined if the client is not registered with the
server.
Parameters
ctx?
OAuthClientInformationContext
Carries the resolved authorization-server issuer. Providers
that persist credentials per authorization server should return the entry
keyed by ctx.issuer. Providers with a single credential set may ignore it.
Returns
Promise<StoredOAuthClientInformation | undefined>
Implementation of
codeVerifier()
Returns
string
Implementation of
discoveryState()
undefined if none is cached.
When available, auth restores the discovery state (authorization server
URL, resource metadata, etc.) instead of performing RFC 9728 discovery, reducing
latency on subsequent calls.
Hosts should call invalidateCredentials with scope 'discovery'
on repeated 401s so a changed authorization_servers list is picked up; the
SDK does not invoke that scope itself.
MUST persist with the same durability as codeVerifier (survives the redirect
round-trip).
Returns
Promise<OAuthDiscoveryState | undefined>
Implementation of
invalidateCredentials()
Parameters
scope
"all" | "client" | "tokens" | "verifier" | "discovery"
Returns
Promise<void>
Implementation of
redirectToAuthorization()
Parameters
authorizationUrl
URL
Returns
Promise<void>
Implementation of
saveClientInformation()
Parameters
info
StoredOAuthClientInformation
ctx?
OAuthClientInformationContext
Carries the resolved authorization-server issuer. Providers
that persist credentials per authorization server should store the entry
keyed by ctx.issuer.
Returns
Promise<void>
Implementation of
saveCodeVerifier()
Parameters
codeVerifier
string
Returns
void
Implementation of
saveDiscoveryState()
auth calls.
This state can also be provided out-of-band (e.g., from a previous session or
external configuration) to bootstrap the OAuth flow without discovery.
Called by auth after successful discovery.
MUST persist with the same durability as codeVerifier (survives the redirect
round-trip).
Parameters
state
OAuthDiscoveryState
Returns
Promise<void>
Implementation of
saveTokens()
Parameters
tokens
StoredOAuthTokens
ctx?
OAuthClientInformationContext
Carries the resolved authorization-server issuer. Providers
that persist tokens per authorization server should store the entry
keyed by ctx.issuer.
Returns
Promise<void>
Implementation of
tokens()
undefined if there are no saved tokens.
Parameters
ctx?
OAuthClientInformationContext
Carries the resolved authorization-server issuer. Providers
that persist tokens per authorization server should return the entry
keyed by ctx.issuer. Providers with a single token set may ignore it.
When called with no ctx — the transport’s per-request bearer-token
read — return the most-recently-saved token set; do not return
undefined for ctx === undefined.
Returns
Promise<StoredOAuthTokens | undefined>
Implementation of
waitForCallback()
URLSearchParams
(including code and, when present, the RFC 9207 iss parameter).
Must be called after the UnauthorizedError thrown by connect() is caught.
Pass the result directly to the transport’s finishAuth(callbackParams).
Parameters
timeoutMs?
number = ...
Returns
Promise<URLSearchParams>