server.authentication.enabled
flag and then configure the appropriate authentication method as indicated in the relevant section of this document. When creating a Tyk OAS API from an OpenAPI description, Tyk can automatically enable authentication based upon the content of the OpenAPI description as described here.
When using Tyk Classic APIs, each authentication middleware has its own fields within the API definition
strip_auth_data
).
externalOAuthServer
set enabled
to true
to enable the middleware.
providers
is an array of multiple IDP configurations, with each IDP config being an element in the providers
array.
jwt
or use introspection via instropection
in the providers
section .
providers
to have only one element, ie one IDP configured.enabled
- enables JWT validation.signingMethod
- specifies the signing method used to sign the JWT.source
- the secret source, it can be one of:
issuedAtValidationSkew
, notBeforeValidationSkew
, expiresAtValidationSkew
can be used to configure clock skew for json web token validation.identityBaseField
- the identity key name for claims. If empty it will default to sub
.provider.introspection
section of the contract. This makes a network call to the configured introspection endpoint with the provided clientID
and clientSecret
to introspect the access token.
enabled
- enables OAuth introspectionclientID
- clientID used for OAuth introspection, available from IDPclientSecret
- secret used to authenticate introspection call, available from IDPurl
- endpoint URL to make the introspection callidentityBaseField
- the identity key name for claims. If empty it will default to sub
.enabled
is set to true
inside the cache
configuration of introspection
. Then it retrieves the value from the cache until the timeout
value finishes. However, there is a trade-off here. When the timeout is long, it may result in accessing the upstream with a revoked access token. When it is short, the cache is not used as much resulting in more network calls.
The recommended way to handle this balance is to never set the timeout
value beyond the expiration time of the token, which would have been returned in the exp
parameter of the introspection response.
See the example introspection cache configuration: