Extends
Constructors
Constructor
Parameters
options
BrowserOAuthOptions
Returns
BrowserOAuth
Overrides
OAuth.constructor
Properties
_callbackPromise
Inherited from
OAuth._callbackPromise
_callbackReject
Inherited from
OAuth._callbackReject
_callbackResolve
Inherited from
OAuth._callbackResolve
clientMetadataUrl?
Inherited from
OAuth.clientMetadataUrl
Accessors
callbackServerPort
Get Signature
Returns
number | null
Inherited from
OAuth.callbackServerPort
clientMetadata
Get Signature
Returns
Overrides
OAuth.clientMetadata
redirectUrl
Get Signature
undefined for non-interactive flows that don’t require user interaction
(e.g., client_credentials, jwt-bearer).
Returns
string
Overrides
OAuth.redirectUrl
Methods
_armCallbackPromise()
Returns
void
Inherited from
OAuth._armCallbackPromise
_awaitCallback()
Parameters
timeoutMs
number
Returns
Promise<URLSearchParams>
Inherited from
OAuth._awaitCallback
_bind()
Parameters
serverUrl
string
Returns
void
Inherited from
OAuth._bind
_rejectCallback()
Parameters
err
Error
Returns
void
Inherited from
OAuth._rejectCallback
_resolveCallback()
Parameters
params
URLSearchParams
Returns
void
Inherited from
OAuth._resolveCallback
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>
Inherited from
OAuth.clientInformation
codeVerifier()
Returns
string
Inherited from
OAuth.codeVerifier
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>
Inherited from
OAuth.discoveryState
invalidateCredentials()
Parameters
scope
"all" | "client" | "tokens" | "verifier" | "discovery"
Returns
Promise<void>
Inherited from
OAuth.invalidateCredentials
redirectToAuthorization()
Parameters
authorizationUrl
URL
Returns
Promise<void>
Overrides
OAuth.redirectToAuthorization
resumeFromRedirect()
URLSearchParams (including code and, when present, iss) — pass
directly to finishAuth() — or null if there is no code. Throws if
the provider returned an error.
Parameters
href?
string = window.location.href
Returns
URLSearchParams | null
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>
Inherited from
OAuth.saveClientInformation
saveCodeVerifier()
Parameters
codeVerifier
string
Returns
void
Inherited from
OAuth.saveCodeVerifier
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>
Inherited from
OAuth.saveDiscoveryState
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>
Inherited from
OAuth.saveTokens
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>
Inherited from
OAuth.tokens
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>
Overrides
OAuth.waitForCallback