You are browsing documentation for an older version. See the latest documentation here.
OIDC Authenticated Group Mapping
Available with Kong Gateway Enterprise subscription - Contact Sales
Using Kong’s OpenID Connect plugin (OIDC), you can map identity provider (IdP) groups to Kong roles. Adding a user to Kong in this way gives them access to Kong based on their group in the IdP.
Admin accounts are now created automatically when you map your identity provider (IdP) groups to Kong roles. You do not need to create the users, groups, and roles separately. These users then accept invitations to join Kong Manager and log in with their IdP credentials.
If an admin’s group changes in the IdP, their Kong admin account’s associated role also changes in Kong Gateway the next time they log in to Kong Manager. The mapping removes the task of manually managing access in Kong Gateway, because it makes the IdP the system of record.
Prerequisites
- An IdP with an authorization server and users with groups assigned
- Kong Gateway installed and configured
- Kong Manager enabled
- RBAC enabled
- (Kubernetes) Helm installed
Apply OIDC auth mapping to Kong Gateway
Review important values
In the following examples, you specify the admin_claim
and authenticated_groups_claim
parameters
to identify which admin value and role name to map from the IdP to Kong Gateway, as well as
the admin_auto_create_rbac_token_disabled
to specify whether an RBAC token is created for admins in Kong.
-
The
admin_claim
value specifies which IdP username value should map to Kong Manager. The username and password are required for the user to log into the IdP. -
The
authenticated_groups_claim
value specifies which IdP claim should be used to assign Kong Gateway roles to the specified Kong Gateway admin.This value depends on your IdP – for example, Okta configures claims for
groups
, and another IdP might configure them asroles
.In the IdP, the group claim value must follow the format
<workspace_name>:<role_name>
.For example, if
"authenticated_groups_claim": ["groups"]
is specified, and in the IdPgroups:["default:super-admin"]
is specified, the administrators specified inadmin_claim
are assigned to the super-admin role in the default Kong Gateway workspace.If the mapping does not work as expected, decode the JWT that’s created by your IdP, and make sure that the admin ID token includes the key:value pair
groups:["default:super-admin"]
for the case of this example, or the appropriate claim name and claim value as set in your IdP. - The
admin_auto_create_rbac_token_disabled
boolean enables or disables RBAC token creation when automatically creating admins with OpenID Connect. The default isfalse
.- Set to
true
to disable automatic token creation for admins - Set to
false
to enable automatic token creation for admins
- Set to
- The
admin_auto_create
boolean enables or disables admin auto-creation with OpenID Connect. The default istrue
.- Set to
true
to enable automatic admin creation - Set to
false
to disable automatic admin creation
- Set to