このページは、まだ日本語ではご利用いただけません。翻訳中です。
構成
このプラグインはDBレスモードには対応していません。
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プラグインは以下のプロトコルに対応しています:
grpc, grpcs, http, https, ws, wss
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
name or plugin
string requiredプラグイン名。この場合は
oauth2。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
nameです。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
pluginです。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
instance_name
stringプラグインのインスタンスを識別するための任意のカスタム名 (例:
oauth2_my-service。インスタンス名はKong ManagerとKonnectに表示されるので、 例えば複数のサービスで同じプラグインを複数のコンテキストで実行する場合に便利です。また、Kong Admin API経由で特定のプラグインインスタンスに アクセスするためにも使用できます。
インスタンス名は、次のコンテキスト内で一意である必要があります。
- Kong Gateway Enterpriseのワークスペース内
- Konnectのコントロールプレーン(CP)またはコントロールプレーン(CP)グループ内
- Kong Gateway (OSS)の全世界
-
service.name or service.id
stringプラグインが対象とするサービス名または ID。最上位の
/pluginsエンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/pluginsを使用する場合は必要ありません。 -
route.name or route.id
stringプラグインがターゲットとするルート名または ID。最上位の
/pluginsエンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/pluginsを使用する場合は必要ありません。 -
enabled
boolean default:trueこのプラグインが適用されるかどうか。
-
config
record required-
scopes
array of typestringDescribes an array of scope names that will be available to the end user. If
mandatory_scopeis set totrue, thenscopesare required.
-
mandatory_scope
boolean required default:falseAn optional boolean value telling the plugin to require at least one
scopeto be authorized by the end user.
-
provision_key
string required encryptedThe unique key the plugin has generated when it has been added to the Service.
-
token_expiration
number required default:7200An 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_code
boolean required default:falseAn optional boolean value to enable the three-legged Authorization Code flow (RFC 6742 Section 4.1).
-
enable_implicit_grant
boolean required default:falseAn 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_credentials
boolean required default:falseAn optional boolean value to enable the Client Credentials Grant flow (RFC 6742 Section 4.4).
-
enable_password_grant
boolean required default:falseAn optional boolean value to enable the Resource Owner Password Credentials Grant flow (RFC 6742 Section 4.3).
-
hide_credentials
boolean required default:falseAn optional boolean value telling the plugin to show or hide the credential from the upstream service.
-
accept_http_if_already_terminated
boolean required default:falseAccepts HTTPs requests that have already been terminated by a proxy or load balancer.
-
anonymous
stringAn optional string (consumer UUID or username) value to use as an “anonymous” consumer if authentication fails.
-
global_credentials
boolean required default:falseAn 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
config.global_credentials=true.
-
auth_header_name
string default:authorizationThe name of the header that is supposed to carry the access token.
-
refresh_token_ttl
number required default:1209600between:0100000000Time-to-live value for data
-
reuse_refresh_token
boolean required default:falseAn optional boolean value that indicates whether an OAuth refresh token is reused when refreshing an access token.
-
persistent_refresh_token
boolean required default:false
-
pkce
string default:laxMust be one of:none,lax,strictSpecifies a mode of how the Proof Key for Code Exchange (PKCE) should be handled by the plugin.
-
realm
stringWhen authentication fails the plugin sends
WWW-Authenticateheader withrealmattribute value.
-