Token validation for multiple IdPs

You can verify tokens issued by multiple IdP using the extra_jwks_uris configuration option, with the following considerations:

  • Since the plugin only accepts a single issuer, any iss claim verification will fail for tokens that come from a different IdP than the one that was used in the issuer configuration option. Add all issuers as they appear in the iss claims of your tokens to the config.issuers_allowed setting.
  • If you make any changes to the extra_jwks_uris value, you have to clear the second level DB cache for the change to become effective. See Delete a Discovery Cache Object.

This example shows how to configure two different extra_jwks_uris to support token validation for two different IdPs.

Prerequisites

  • A configured identity provider (IdP)

Environment variables

  • ISSUER: The issuer authentication URL for your IdP. For example, if you’re using Keycloak as your IdP, the issuer URL looks like this: http://localhost:8080/realms/example-realm

  • CLIENT_ID: The client ID that the plugin uses when it calls authenticated endpoints of the IdP.

  • CLIENT_SECRET: The client secret needed to connect to your IdP.

Set up the plugin

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!