OAuth2Config
Defined in: packages/gateway/src/policies/auth/oauth2.ts:16
Configuration for the oauth2 policy.
Extends
Section titled “Extends”Properties
Section titled “Properties”cacheMaxEntries?
Section titled “cacheMaxEntries?”
optionalcacheMaxEntries?:number
Defined in: packages/gateway/src/policies/auth/oauth2.ts:38
Maximum number of tokens to cache. Default: 100.
cacheTtlSeconds?
Section titled “cacheTtlSeconds?”
optionalcacheTtlSeconds?:number
Defined in: packages/gateway/src/policies/auth/oauth2.ts:36
Cache introspection results for this many seconds. Default: 0 (no cache).
clientId?
Section titled “clientId?”
optionalclientId?:string
Defined in: packages/gateway/src/policies/auth/oauth2.ts:20
Client ID for authenticating with the introspection endpoint.
clientSecret?
Section titled “clientSecret?”
optionalclientSecret?:string
Defined in: packages/gateway/src/policies/auth/oauth2.ts:22
Client secret for authenticating with the introspection endpoint.
forwardTokenInfo?
Section titled “forwardTokenInfo?”
optionalforwardTokenInfo?:Record<string,string>
Defined in: packages/gateway/src/policies/auth/oauth2.ts:34
Map introspection response fields to request headers. Only applies with introspection.
headerName?
Section titled “headerName?”
optionalheaderName?:string
Defined in: packages/gateway/src/policies/auth/oauth2.ts:28
Header name when tokenLocation is “header”. Default: “authorization”.
headerPrefix?
Section titled “headerPrefix?”
optionalheaderPrefix?:string
Defined in: packages/gateway/src/policies/auth/oauth2.ts:30
Prefix to strip from header value. Default: “Bearer”.
introspectionTimeoutMs?
Section titled “introspectionTimeoutMs?”
optionalintrospectionTimeoutMs?:number
Defined in: packages/gateway/src/policies/auth/oauth2.ts:42
Introspection endpoint fetch timeout in milliseconds. Default: 5000.
introspectionUrl?
Section titled “introspectionUrl?”
optionalintrospectionUrl?:string
Defined in: packages/gateway/src/policies/auth/oauth2.ts:18
OAuth2 token introspection endpoint (RFC 7662).
localValidate?
Section titled “localValidate?”
optionallocalValidate?: (token) =>boolean|Promise<boolean>
Defined in: packages/gateway/src/policies/auth/oauth2.ts:24
Local validation function as alternative to introspection. Takes precedence if both provided.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean | Promise<boolean>
queryParam?
Section titled “queryParam?”
optionalqueryParam?:string
Defined in: packages/gateway/src/policies/auth/oauth2.ts:32
Query param name when tokenLocation is “query”. Default: “access_token”.
requiredScopes?
Section titled “requiredScopes?”
optionalrequiredScopes?:string[]
Defined in: packages/gateway/src/policies/auth/oauth2.ts:40
Required scopes - token must have ALL of these (space-separated scope string).
optionalskip?: (c) =>boolean|Promise<boolean>
Defined in: packages/gateway/src/policies/types.ts:90
Skip this policy when condition returns true
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean | Promise<boolean>
Inherited from
Section titled “Inherited from”tokenLocation?
Section titled “tokenLocation?”
optionaltokenLocation?:"query"|"header"
Defined in: packages/gateway/src/policies/auth/oauth2.ts:26
Where to look for the token. Default: “header”.