Askr documentation
Generated API snapshot

@askrjs/auth/oidc

Exports from the declarations published in @askrjs/auth. Signatures reflect the published artifact.

Exports

This entrypoint publishes 11 exports. Use the anchored symbol rows for direct links. Type-only exports are labeled separately from runtime values.

createOidcClienttype

createOidcClient: (options: OidcClientOptions) => OidcClient

Create an OIDC client with discovery caching and ID-token validation.

OidcAuthorizationRequesttype

OidcAuthorizationRequest: any

Generated authorization URL and callback values.

url
Provider authorization URL.
state
CSRF state value.
nonce
Replay-protection nonce.
codeVerifier
PKCE verifier retained for callback exchange.

OidcAuthorizationRequestOptionstype

OidcAuthorizationRequestOptions: any

Optional state, nonce, and PKCE values for an authorization request.

state
CSRF state value.
nonce
Replay-protection nonce.
codeVerifier
PKCE verifier.
loginHint
Optional provider login hint.

OidcClienttype

OidcClient: any

High-level OIDC discovery, authorization, and callback client.

discover
Discover and cache provider metadata.
createAuthorizationRequest
Build an authorization URL and callback state.
exchangeCode
Exchange an authorization code and validate its ID token.

OidcClientErrortype

OidcClientError: typeof OidcClientError

Error raised while discovering, exchanging, or validating OIDC tokens.

code
Error category used for programmatic handling.
name
Error category used for programmatic handling.

OidcClientErrorCodetype

OidcClientErrorCode: "discovery-failed" | "invalid-metadata" | "state-mismatch" | "exchange-failed" | "invalid-token-response" | "invalid-id-token"

Stable failure codes for OIDC client operations.

OidcClientOptionstype

OidcClientOptions: any

Client credentials and callback settings for OIDC.

issuer
Provider issuer URL.
clientId
Registered client identifier.
clientSecret
Optional confidential-client secret.
redirectUri
Registered redirect URI.
scopes
Requested scopes.
fetch
Fetch implementation for provider requests.

OidcCodeExchangetype

OidcCodeExchange: any

Callback code and original authorization request values.

code
Authorization code.
state
Returned CSRF state.
request
Stored authorization request values.

OidcCodeExchangeResulttype

OidcCodeExchangeResult: any

Result of exchanging an authorization code.

tokens
Provider tokens.
principal
Principal derived from the validated ID token.

OidcProviderMetadatatype

OidcProviderMetadata: any

Discovery metadata published by an OpenID Connect provider.

issuer
Provider issuer URL.
authorization_endpoint
Authorization endpoint URL.
token_endpoint
Token endpoint URL.
jwks_uri
JWKS endpoint URL.
userinfo_endpoint
Optional user-info endpoint URL.
end_session_endpoint
Optional end-session endpoint URL.

OidcTokenResponsetype

OidcTokenResponse: any

Token response returned by an OIDC provider.

access_token
Access token.
token_type
Token type, normally Bearer.
id_token
Optional ID token.
refresh_token
Optional refresh token.
expires_in
Optional lifetime in seconds.