コンテンツにスキップ
Kong Logo | Kong Docs Logo
  • ドキュメント
    • API仕様を確認する
      View all API Specs すべてのAPI仕様を表示 View all API Specs arrow image
    • ドキュメンテーション
      API Specs
      Kong Gateway
      軽量、高速、柔軟なクラウドネイティブAPIゲートウェイ
      Kong Konnect
      SaaSのエンドツーエンド接続のための単一プラットフォーム
      Kong AI Gateway
      GenAI インフラストラクチャ向けマルチ LLM AI Gateway
      Kong Mesh
      Kuma と Envoy をベースにしたエンタープライズサービスメッシュ
      decK
      Kongの構成を宣言型で管理する上で役立ちます
      Kong Ingress Controller
      Kubernetesクラスタ内で動作し、Kongをプロキシトラフィックに設定する
      Kong Gateway Operator
      YAMLマニフェストを使用してKubernetes上のKongデプロイメントを管理する
      Insomnia
      コラボレーティブAPI開発プラットフォーム
  • Plugin Hub
    • Plugin Hubを探索する
      View all plugins すべてのプラグインを表示 View all plugins arrow image
    • 機能性 すべて表示 View all arrow image
      すべてのプラグインを表示
      AI's icon
      AI
      マルチ LLM AI Gatewayプラグインを使用してAIトラフィックを管理、保護、制御する
      認証's icon
      認証
      認証レイヤーでサービスを保護する
      セキュリティ's icon
      セキュリティ
      追加のセキュリティレイヤーでサービスを保護する
      トラフィック制御's icon
      トラフィック制御
      インバウンドおよびアウトバウンドAPIトラフィックの管理、スロットル、制限
      サーバーレス's icon
      サーバーレス
      他のプラグインと組み合わせてサーバーレス関数を呼び出します
      分析と監視's icon
      分析と監視
      APIとマイクロサービストラフィックを視覚化、検査、監視
      変革's icon
      変革
      Kongでリクエストとレスポンスをその場で変換
      ログ記録's icon
      ログ記録
      インフラストラクチャに最適なトランスポートを使用して、リクエストと応答データをログに記録します
  • サポート
  • コミュニティ
  • Kongアカデミー
デモを見る 無料トライアルを開始
Kong Gateway
2.8.x LTS
  • Home icon
  • Kong Gateway
  • Configure
  • Auth
  • OpenID Connect with Curity
report-issue問題を報告する
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Kong AI Gateway
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • ドキュメント投稿ガイドライン
  • 3.10.x (latest)
  • 3.9.x
  • 3.8.x
  • 3.7.x
  • 3.6.x
  • 3.5.x
  • 3.4.x (LTS)
  • 3.3.x
  • 2.8.x (LTS)
  • アーカイブ (2.6より前)
  • Introduction
    • Overview of Kong Gateway
    • Version Support Policy
    • Stages of Software Availability
    • Changelog
  • Install and Run
    • Overview
    • Kubernetes
    • Helm
    • OpenShift with Helm
    • Docker
    • Amazon Linux
    • CentOS
    • Debian
    • RHEL
    • Ubuntu
    • Migrating from OSS to EE
    • Upgrade Kong Gateway
    • Upgrade Kong Gateway OSS
    • Upgrade from 2.8 LTS to 3.4 LTS
  • Get Started
    • Quickstart Guide
      • Configuring a Service
      • Configuring a gRPC Service
      • Enabling Plugins
      • Adding Consumers
    • Comprehensive Guide
      • Prepare to Administer
      • Expose your Services
      • Protect your Services
      • Improve Performance
      • Secure Services
      • Set Up Intelligent Load Balancing
      • Manage Administrative Teams
      • Publish, Locate, and Consume Services
  • Plan and Deploy
    • Running Kong as a Non-Root User
    • Resource Sizing Guidelines
    • Hybrid Mode
      • Deploy Kong Gateway in Hybrid Mode
    • Kubernetes Deployment Options
    • Control Kong Gateway through systemd
    • Performance Testing Framework
    • DNS Considerations
    • Default Ports
    • Licenses
      • Access Your License
      • Deploy Your License
      • Monitor License Usage
    • Security
      • Start Kong Gateway Securely
      • Keyring and Data Encryption
      • Kong Security Update Process
      • Secrets Management
        • Getting Started
        • Advanced Usage
        • Backends
          • Environment Variables
          • AWS Secrets Manager
          • GCP Secret Manager
          • HashiCorp Vault
        • Reference Format
  • Configure
    • Authentication and Authorization
      • Authentication Reference
      • OpenID Connect Plugin
        • OpenID Connect with Curity
        • OpenID Connect with Azure AD
        • OpenID Connect with Google
        • OpenID Connect with Okta
        • OpenID Connect with Auth0
        • OpenID Connect with Cognito
        • OpenID Connect Plugin Reference
      • Allowing Multiple Authentication Methods
      • Auth for Kong Manager
        • Create a Super Admin
        • Configure Networking
        • Configure Kong Manager to Send Email
        • Reset Passwords and RBAC Tokens
        • Configure Workspaces
        • Basic Auth
        • LDAP
        • OIDC
        • Sessions
      • Role-based Access Control (RBAC)
        • Add a Role
        • Add a User
        • Add an Admin
      • Mapping LDAP Service Directory Groups to Kong Roles
    • Configure gRPC Plugins
    • GraphQL Quickstart
    • Logging Reference
    • Network and Firewall
  • Dev Portal
    • Overview
    • Enable the Dev Portal
    • Structure and File Types
    • Portal API Documentation
    • Working with Templates
    • Using the Editor
    • Configuration
      • Authentication
        • Basic Auth
        • Key Auth
        • OIDC
        • Sessions
        • Adding Custom Registration Fields
      • SMTP
      • Workspaces
    • Administration
      • Manage Developers
      • Developer Roles and Content Permissions
      • Application Registration
        • Authorization Provider Strategy
        • Enable Application Registration
        • Enable Key Authentication for Application Registration
        • External OAuth2 Support
        • Set up Okta and Kong for external OAuth
        • Set Up Azure AD and Kong for External Authentication
        • Manage Applications
    • Customization
      • Easy Theme Editing
      • Migrating Templates Between Workspaces
      • Markdown Rendering Module
      • Customizing Portal Emails
      • Adding and Using JavaScript Assets
      • Single Page App in Dev Portal
      • Alternate OpenAPI Renderer
    • Helpers CLI
  • Monitor
    • Kong Vitals
      • Metrics
      • Reports
      • Vitals with InfluxDB
      • Vitals with Prometheus
      • Estimate Vitals Storage in PostgreSQL
    • Prometheus plugin
    • Zipkin plugin
  • Reference
    • Admin API
      • DB-less Mode
      • Declarative Configuration
      • Supported Content Types
      • Information Routes
      • Health Routes
      • Tags
      • Service Object
      • Route Object
      • Consumer Object
      • Plugin Object
      • Certificate Object
      • CA Certificate Object
      • SNI Object
      • Upstream Object
      • Target Object
      • Vaults Beta
      • Licenses
        • Licenses Reference
        • Licenses Examples
      • Workspaces
        • Workspaces Reference
        • Workspace Examples
      • RBAC
        • RBAC Reference
        • RBAC Examples
      • Admins
        • API Reference
        • Examples
      • Developers
      • Consumer Groups
        • API Reference
        • Examples
      • Event Hooks
        • Event Hooks Reference
        • Examples
      • Audit Logging
      • Keyring and Data Encryption
      • Securing the Admin API
    • DB-less and Declarative Configuration
    • Configuration Reference
    • CLI Reference
    • Load Balancing Reference
    • Proxy Reference
    • Rate Limiting Library
    • Health Checks and Circuit Breakers Reference
    • Clustering Reference
    • Plugin Development Kit
      • kong.client
      • kong.client.tls
      • kong.cluster
      • kong.ctx
      • kong.ip
      • kong.log
      • kong.nginx
      • kong.node
      • kong.request
      • kong.response
      • kong.router
      • kong.service
      • kong.service.request
      • kong.service.response
      • kong.table
      • kong.vault
    • Plugin Development Guide
      • Introduction
      • File structure
      • Implementing custom logic
      • Plugin configuration
      • Accessing the datastore
      • Storing custom entities
      • Caching custom entities
      • Extending the Admin API
      • Writing tests
      • (un)Installing your plugin
    • Plugins in Other Languages
    • File Permissions Reference
enterprise-switcher-icon 次に切り替える: OSS
On this pageOn this page
  • Phantom Token Integration
    • Prerequisites
    • Configure Kong
    • Test the configuration
    • Resources
  • Kong Dev Portal Authentication
    • Curity Setup
    • Configure OpenID Connect in the Kong Developer Portal
    • Curity Authentication Action
    • Conclusion

このページは、まだ日本語ではご利用いただけません。翻訳中です。

旧バージョンのドキュメントを参照しています。 最新のドキュメントはこちらをご参照ください。

OpenID Connect with Curity
Available with Kong Gateway Enterprise subscription - Contact Sales

Phantom Token Integration

This guide describes how to integrate Kong Gateway Enterprise and the Curity Identity Server using the Kong OpenID Connect plugin.

This guide focuses on configuring the plugin for introspection, and especially as it relates to the introspection using the Phantom Token pattern. Some tweaks are made so that a phantom token is provided in the introspection response and then passed on to the upstream API.

Configuring the Curity Identity Server to provide a Phantom Token in the introspection response is outlined in more detail in this Introspection and Phantom Tokens article.

Prerequisites

  • An installation of the Curity Identity Server
  • An introspection endpoint configured with the Token Procedure Approach

Configure Kong

The Kong OpenID Connect plugin is configured to introspect an incoming opaque access token and in return receive a JWT in the introspection response from the Curity Identity Server. The plugin is enabled for a service or a route.

As part of the introspection, the OpenID Connect plugin also has the ability to validate that required scopes are available in the introspected token. Access to the requested API are denied if the correct scopes are missing.

If access is granted, the JWT from the introspection response is added to a header and forwarded to the upstream API where it can be consumed.

Create a service

Create a service that can be used to test the integration.

curl -i -X POST http://localhost:8001/services/ \
  --data name="httpbin" \
  --data protocol="http" \
  --data url="https://httpbin.konghq.com"

Create a route

Add a route to the service.

curl -i -X POST http://localhost:8001/services/httpbin/routes \
  --data "paths[]=/httpbin"

Configure the plugin

The Kong OpenID Connect plugin is enabled for the previously created service. In the example below, the openid scope is required in order for access to be granted. As noted by the config.upstream_headers_claims configuration, the plugin looks for the JWT (the phantom token) claim in the introspection response. The config.upstream_headers_names configuration extracts the JWT from the introspection response and adds it to a phantom_token header in the call to the upstream API.

curl -X POST http://localhost:8001/services/httpbin/plugins \
--data name="openid-connect" \
--data config.issuer="https://idsvr.example.com/oauth/v2/oauth-anonymous" \
--data config.client_id="gateway-client" \
--data config.client_secret="Password1" \
--data config.scopes_required="openid" \
--data config.hide_credentials="true" \
--data config.upstream_access_token_header= \
--data config.upstream_headers_claims="phantom_token" \
--data config.upstream_headers_names="phantom_token" \
--data config.auth_methods="introspection"
Parameter Description Example Required for integration
config.issuer Used for discovery. Kong appends /.well-known/openid-configuration. Should be set to the realm or iss if no discovery endpoint is available. https://idsvr.example.com/oauth/v2/oauth-anonymous Yes
config.client_id The ID of a client with the introspection capability gateway-client Yes
config.client_secret Secret of the client used for introspection Password1 Yes
config.scopes_required Optional scopes required in introspection result for coarse grained authorization. By default the plugin looks for the scopes in the scopes claim in the introspection result. This could be overridden with the config.scopes_claim configuration. openid email records_read No
config.hide_credentials Boolean value. This will prevent the incoming Access Token from being forwarded to the upstream API. true No
config.upstream_access_token_header In order to prevent the plugin from adding the Access Token back in the upstream request, actively set this value to nothing (aka, nil) by setting config.upstream_access_token_header= as in the example above . This configuration works in conjunction with config.hide_credentials to prevent the incoming Access Token from being passed to the upstream API. authorization:bearer No
config.upstream_headers_claims Contains claim that holds Phantom Token in the introspection result. phantom_token Yes
config.upstream_headers_names Contains upstream header name that will hold the Phantom Token from the introspection result. phantom_token Yes
config.auth_methods Several methods are supported for authenticating the request. For this use case, this should be limited to introspection. introspection No
config.cache_introspection Boolean value that controls whether an introspection result should be cached. true No
config.introspect_jwt_tokens Boolean value that controls if JWTs sent in an Authorization header should also be introspected. false No
config.introspection_endpoint Endpoint for introspection. Might be needed if discovery is not possible. https://idsvr.example.com/oauth/v2/oauth-introspect No

Test the configuration

Any supported OAuth/OIDC flow can be used to obtain an opaque access token from the Curity Identity Server. Several approaches for obtaining a token are outlined in the Curity Getting Started Guide. Make sure that the token issued contains the openid scope.

Call the exposed service created earlier and pass the opaque access token in the Authorization header.

curl -X GET http://kong:8000/httpbin/get \
--header "Authorization: Bearer <OPAQUE ACCESS TOKEN"

Kong introspects the opaque token and receives the JWT in the response. The JWT is forwarded to the upstream API. Because the configured upstream API is httpbin, it is echoed back. The below sample response shows the phantom_token that contains the JWT and can be consumed by the API. The response is truncated for readability.

{
    "args": {},
    "headers": {
        ...
        "Host": "httpbin.konghq.com",
        "Phantom-Token": "eyJraWQiOiIxN...",
        "X-Forwarded-Host": "localhost",
        "X-Forwarded-Path": "/httpbin/get",
        "X-Forwarded-Prefix": "/httpbin"
    },
    "origin": "172.27.0.1, 69.181.2.136",
    "url": "http://localhost/get"
}

Resources

  • Overview of the Phantom Token Pattern
  • Information on the Introspection and Phantom Tokens flow
  • Installing the Curity Identity Server

Kong Dev Portal Authentication

The Kong Developer Portal is a part of Kong Gateway Enterprise. The portal enables developers to access and manage configured services and documentation to provide a streamlined onboarding process. The Kong Dev Portal supports various options for user authentication and access control. This guide outlines how to configure the Kong OpenID Connect Plugin to leverage the Curity Identity Server as a third-party Identity Provider for user Authentication to the Dev Portal.

Curity Setup

The Kong Dev Portal needs a client configured in the Curity Identity Server. The Curity Getting Started Guide outlines details on how to configure a client. The configuration details below should be sufficient:

  • Authentication method: secret. Make note of the Secret and use it in the client_secret field in the Developer Portal configuration (see below).
  • Capabilities: Code Flow.
  • Following scopes: openid, profile, and email.
  • Choose suitable authentication methods.
  • Add redirect URI (by default http://kong:8004/<WORKSPACE_NAME>/auth).

NOTE: There is an issue with short-lived access tokens that is under investigation. Increase the Access Token Time to Live in the client configuration to 3000 as a temporary workaround.

More information is available in the Code Flow tutorial.

Configure OpenID Connect in the Kong Developer Portal

Enabling the Kong Developer Portal is outlined in the Kong Dev Portal Documentation and not covered in this article. The documentation also covers how to configure the OpenID Connect Plugin.

Example Configuration Object

Below is an example configuration object that is used to configure the OIDC plugin for the Dev Portal.

{
    "redirect_uri": ["https://kong-dev-portal:8004/default/auth"],
    "consumer_by": ["username","custom_id","id"],
    "leeway": 1000,
    "scopes": ["openid","profile","email"],
    "logout_query_arg": "logout",
    "login_redirect_uri": ["https://kong-dev-portal:8003/default"],
    "login_action": "redirect",
    "logout_redirect_uri": ["https://kong-dev-portal:8003/default"],
    "ssl_verify": false,
    "client_id": ["kong-dev-portal-client"],
    "forbidden_redirect_uri": ["https://kong-dev-portal:8003/unauthorized"],
    "client_secret": ["Pa$$w0rd!"],
    "issuer": "https://idsvr.example.com/oauth/v2/oauth-anonymous/",
    "logout_methods": ["GET"],
    "consumer_claim": ["email"],
    "login_redirect_mode": "query"
}

Curity Authentication Action

An Authentication Action to automatically provision the user to the Kong Developer Portal is available in the Curity GitHub repository. Using the Action is not mandatory as the user could be provisioned in other ways, such as manually through the Kong Developer portal login page. However, using the Authentication Action would streamline the user flow since the Action takes the user’s full name and the email from the Curity Authenticator and automatically provision that to the Kong Developer Portal using the exposed API.

The Kong Developer Portal User Provisioner action is available as open source and can be forked to fit the needs of the environment as needed.

Configuration

This Action is straightforward to configure. An HTTP Client is needed to communicate with the Kong Dev Portal API. By default, the HTTP Authentication can be left out. Only a correct scheme needs to be configured (HTTP or HTTPS).

The Action also configures the URL to the registration endpoint of the Kong Developer Portal. Here the scheme needs to match what’s configured in the HTTP Client used.

When the action is created, it can be assigned to the Authenticators used in the client configured in the Curity Identity Server as described above.

Action to Resolve Additional User Information

Depending on the Authenticator used, an additional Action may be needed to resolve additional information. By default, The Kong Developer portal provisioning requires Full Name and email. If the Authenticator does not provide this, it’s possible to use an Action to resolve the data. This could be as simple as a Data Source action configured to use a Data Source that provides the information.

Chain Actions

By default, the Kong Developer Portal Provisioner Action works on the default account table schema of the Curity Identity Server database. This provides email as a column, but the Full Name is not readily available. The Action operates on the attributes column and parse the information to pass the user’s Full Name to the Kong Dev Portal.

The attributes column contains this structure:

{"emails":[{"value":"alice@example.com","primary":true}],"phoneNumbers":[{"value":"555-123-1234","primary":true}],"name":{"givenName":"alice","familyName":"anderson"},"agreeToTerms":"on","urn:se:curity:scim:2.0:Devices":[]}

The data source used to resolve additional information needs to be configured with an appropriate Attribute Query. This would look similar to this:

select * from "accounts" where "username"= :subject

Conclusion

With relatively simple configurations in both the Curity Identity Server and the Kong Developer Portal, it’s possible to leverage Curity as the Identity Provider for the Kong Dev Portal. This provides a very seamless flow for user authentication to the Kong Dev Portal. With the added capability of an Authentication Action, it is possible to automatically provision the user to the Kong Dev Portal for an even more streamlined experience.

Thank you for your feedback.
Was this page useful?
情報が多すぎる場合 close cta icon
Kong Konnectを使用すると、より多くの機能とより少ないインフラストラクチャを実現できます。月額1Mリクエストが無料。
無料でお試しください
  • Kong
    APIの世界を動かす

    APIマネジメント、サービスメッシュ、イングレスコントローラーの統合プラットフォームにより、開発者の生産性、セキュリティ、パフォーマンスを大幅に向上します。

    • 製品
      • Kong Konnect
      • Kong Gateway Enterprise
      • Kong Gateway
      • Kong Mesh
      • Kong Ingress Controller
      • Kong Insomnia
      • 製品アップデート
      • 始める
    • ドキュメンテーション
      • Kong Konnectドキュメント
      • Kong Gatewayドキュメント
      • Kong Meshドキュメント
      • Kong Insomniaドキュメント
      • Kong Konnect Plugin Hub
    • オープンソース
      • Kong Gateway
      • Kuma
      • Insomnia
      • Kongコミュニティ
    • 会社概要
      • Kongについて
      • お客様
      • キャリア
      • プレス
      • イベント
      • お問い合わせ
  • 利用規約• プライバシー• 信頼とコンプライアンス
© Kong Inc. 2025