このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
このプラグインはDBレスモードに対応しています。
互換性のあるプロトコル
OAuth 2.0 Introspectionプラグインは以下のプロトコルに対応しています:
grpc, grpcs, http, https
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
name or plugin
string requiredプラグイン名。この場合は
oauth2-introspection。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
nameです。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
pluginです。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
instance_name
stringプラグインのインスタンスを識別するための任意のカスタム名 (例:
oauth2-introspection_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-
introspection_url
string requiredThe full URL to the third-party introspection endpoint.
If the introspection endpoint is
https,lua_ssl_trusted_certificatemust be set inkong.confto ensure the plugin can connect to the endpoint. The CA bundle file location depends on your OS. See the configuration reference for a list.Starting with Kong v2.2, users can set
lua_ssl_trusted_certificate=systemto automatically use the CA bundle from the OS.
-
ttl
number default:30The TTL in seconds for the introspection response. Set to 0 to disable the expiration.
-
token_type_hint
stringThe
token_type_hintvalue to associate to introspection requests.
-
authorization_value
string requiredThe value to set as the
Authorizationheader when querying the introspection endpoint. This depends on the OAuth 2.0 server, but usually is theclient_idandclient_secretas a Base64-encoded Basic Auth string (Basic MG9hNWl...).
-
timeout
integer default:10000An optional timeout in milliseconds when sending data to the upstream server.
-
keepalive
integer default:60000An optional value in milliseconds that defines how long an idle connection lives before being closed.
-
introspect_request
boolean required default:falseA boolean indicating whether to forward information about the current downstream request to the introspect endpoint. If true, headers
X-Request-PathandX-Request-Http-Methodwill be inserted into the introspect request.
-
hide_credentials
boolean default:falseAn optional boolean value telling the plugin to hide the credential to the upstream API server. It will be removed by Kong before proxying the request.
-
run_on_preflight
boolean default:trueA boolean value that indicates whether the plugin should run (and try to authenticate) on
OPTIONSpreflight requests. If set tofalse, thenOPTIONSrequests will always be allowed.
-
anonymous
string len_min:0An 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 consumeridorusernameattribute, and not itscustom_id.
-
consumer_by
string required default:usernameMust be one of:username,client_idA string indicating whether to associate OAuth2
usernameorclient_idwith the consumer’s username. OAuth2usernameis mapped to a consumer’susernamefield, while an OAuth2client_idmaps to a consumer’scustom_id.
-
custom_introspection_headers
map requiredA list of custom headers to be added in the introspection request.
-
custom_claims_forward
set of typestringrequiredA list of custom claims to be forwarded from the introspection response to the upstream request. Claims are forwarded in headers with prefix
X-Credential-{claim-name}.
-