Interface: OAuthServerOptions
Defined in: auth-core/src/oauthServerTypes.ts:426
Configuration for createOAuthHandlers.
Properties
authCodeStore
authCodeStore:
AuthCodeStore
Defined in: auth-core/src/oauthServerTypes.ts:432
App-provided store for short-lived authorization codes.
authorizationCodeTtl?
optionalauthorizationCodeTtl?:number
Defined in: auth-core/src/oauthServerTypes.ts:482
Authorization code lifetime in seconds.
Default
600
clientStore
clientStore:
ClientStore
Defined in: auth-core/src/oauthServerTypes.ts:430
App-provided store for dynamic clients.
endpoints?
optionalendpoints?:object
Defined in: auth-core/src/oauthServerTypes.ts:484
Override the default endpoint paths.
authorize?
optionalauthorize?:string
Default
'/authorize'
jwks?
optionaljwks?:string
Default
'/.well-known/jwks.json'
register?
optionalregister?:string
Default
'/register'
token?
optionaltoken?:string
Default
'/token'
issuer
issuer:
string
Defined in: auth-core/src/oauthServerTypes.ts:428
The authorization server's issuer identifier (its base URL).
issueTokens?
optionalissueTokens?: (args) =>IssuedTokens|Promise<IssuedTokens>
Defined in: auth-core/src/oauthServerTypes.ts:439
App-owned token minting: the engine hands you the subject/scopes/client
and you return the tokens. Optional when signing is set, which mints an
asymmetric JWT itself; when both are set, this one mints and signing
only publishes the JWKS. One of the two is required.
Parameters
| Parameter | Type |
|---|---|
args | IssueTokensArgs |
Returns
IssuedTokens | Promise<IssuedTokens>
onAuthorize
onAuthorize: (
args) =>OnAuthorizeResult|Promise<OnAuthorizeResult>
Defined in: auth-core/src/oauthServerTypes.ts:453
App-owned login/consent. Called on every authorize request; return the
authenticated subject to approve, or { approved: false, redirect } to send
the user to your own login/consent UI.
Parameters
| Parameter | Type |
|---|---|
args | OnAuthorizeArgs |
Returns
OnAuthorizeResult | Promise<OnAuthorizeResult>
onRefreshToken?
optionalonRefreshToken?: (args) =>OnRefreshTokenResult|Promise<OnRefreshTokenResult>
Defined in: auth-core/src/oauthServerTypes.ts:460
App-owned refresh-token validation. Required to support the refresh_token
grant; when omitted, refresh requests get unsupported_grant_type.
Parameters
| Parameter | Type |
|---|---|
args | OnRefreshTokenArgs |
Returns
OnRefreshTokenResult | Promise<OnRefreshTokenResult>
resource?
optionalresource?:string
Defined in: auth-core/src/oauthServerTypes.ts:477
The resource this server issues tokens for. When set:
- OAuthHandlers.protectedResourceMetadata is served, pairing this
resource URL with the issuer as its authorization server (RFC 9728),
with
scopesSupportedas itsscopes_supported. - A
resourceparameter (RFC 8707) on/authorizeor/tokenmust name it, else the request fails withinvalid_target. issueTokensreceives it asresource, to bind the token's audience.
When unset, resource parameters are ignored.
scopesSupported?
optionalscopesSupported?:string[]
Defined in: auth-core/src/oauthServerTypes.ts:464
Scopes advertised in discovery metadata (scopes_supported).
signing?
optionalsigning?:AccessTokenSigningOptions
Defined in: auth-core/src/oauthServerTypes.ts:447
Asymmetric signing keys. When set, the server publishes them at the JWKS
endpoint, advertises it as jwks_uri in its RFC 8414 metadata, and — when
issueTokens is omitted — mints RFC 9068 access tokens (typ: at+jwt)
carrying iss, sub, aud (the resource, or the issuer when unset),
exp, iat, jti, scope, client_id and the app's extra claims.