This plugin is not compatible with DB-less mode.
For its regular work, the plugin needs to both generate and delete tokens, and commit those changes to the database, which is not compatible with DB-less.
In addition to this, its Admin API endpoints offer several POST, PATCH, PUT, and DELETE methods for tokens and credentials. None of them would work on DB-less.
OAuth 2.0 Authentication plugin is compatible with the following protocols:
Here's a list of all the parameters which can be used in this plugin's configuration:
The name of the plugin, in this case
An optional custom name to identify an instance of the plugin, for example
oauth2_my-service. Useful when running the same plugin in multiple contexts, for example, on multiple services.
service.name or service.idstring
The name or ID of the service the plugin targets. Set one of these parameters if adding the plugin to a service through the top-level
/pluginsendpoint. Not required if using
route.name or route.idstring
The name or ID of the route the plugin targets. Set one of these parameters if adding the plugin to a route through the top-level
/pluginsendpoint. Not required if using
Whether this plugin will be applied.
scopesarray of type
Describes an array of scope names that will be available to the end user. If
mandatory_scopeis set to
mandatory_scopeboolean required default:
An optional boolean value telling the plugin to require at least one
scopeto be authorized by the end user.
provision_keystring required encrypted
The unique key the plugin has generated when it has been added to the Service.
token_expirationnumber required default:
An optional integer value telling the plugin how many seconds a token should last, after which the client will need to refresh the token. Set to
0to disable the expiration.
enable_authorization_codeboolean required default:
An optional boolean value to enable the three-legged Authorization Code flow (RFC 6742 Section 4.1).
enable_implicit_grantboolean required default:
An optional boolean value to enable the Implicit Grant flow which allows to provision a token as a result of the authorization process (RFC 6742 Section 4.2).
enable_client_credentialsboolean required default:
An optional boolean value to enable the Client Credentials Grant flow (RFC 6742 Section 4.4).
enable_password_grantboolean required default:
An optional boolean value to enable the Resource Owner Password Credentials Grant flow (RFC 6742 Section 4.3).
hide_credentialsboolean required default:
An optional boolean value telling the plugin to show or hide the credential from the upstream service. If
true, the plugin will strip the credential from the request (the header containing the client credentials) before proxying it.
accept_http_if_already_terminatedboolean required default:
Accepts HTTPs requests that have already been terminated by a proxy or load balancer and the
x-forwarded-proto: httpsheader has been added to the request. Only enable this option if the Kong server cannot be publicly accessed and the only entry point is such proxy or load balancer.
An optional string (consumer UUID or username) value to use as an “anonymous” consumer if authentication fails. If empty (default null), the request fails with an authentication failure
4xx. Note that this value must refer to the consumer
usernameattribute, and not its
global_credentialsboolean required default:
An optional boolean value that allows using the same OAuth credentials generated by the plugin with any other Service whose OAuth 2.0 plugin configuration also has
The name of the header that is supposed to carry the access token. Default:
refresh_token_ttlnumber required default:
An optional integer value telling the plugin how many seconds a token/refresh token pair is valid for, and can be used to generate a new access token. Default value is 2 weeks. Set to
0to keep the token/refresh token pair valid indefinitely.
reuse_refresh_tokenboolean required default:
An optional boolean value that indicates whether an OAuth refresh token is reused when refreshing an access token.
persistent_refresh_tokenboolean required default:
laxMust be one of:
Specifies a mode of how the Proof Key for Code Exchange (PKCE) should be handled by the plugin. The possible modes are
strictmode enforces PKCE on both authorization and token endpoints for all the clients. The
laxmode enforces PKCE for public clients, but it does not enforce it for confidential clients. The
nonemode does not enforce PKCE on any client. In any case, if a client asks for PKCE on authorization endpoint, the PKCE is also enforced on token endpoint.