OIDC Authenticated Group Mapping
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.
- An IdP with an authorization server and users with groups assigned
- Kong Gateway installed and configured
- Kong Manager enabled
- RBAC enabled
- (Kubernetes) installed
Apply OIDC auth mapping to Kong Gateway
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.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 to disable automatic token creation for admins
Set up mapping
Kubernetes with Helm
Docker
kong.conf
Create a configuration file for the OIDC plugin and save it as
admin_gui_auth_conf
.Provide your own values for all fields indicated by curly braces (
{}
):For detailed descriptions of all OIDC parameters, see the .
Create a secret from the file you just created:
kubectl create secret generic kong-idp-conf --from-file=admin_gui_auth_conf -n kong
Update the RBAC section of the deployment
values.yml
file with the following parameters:-
helm upgrade --install kong-ee kong/kong -f ./myvalues.yaml -n kong
If you have a Docker installation, run the following command to set the needed environment variables and reload the Kong Gateway configuration.
Provide your own values for all fields indicated by curly braces ({}
):
Replace {KONG_CONTAINER_ID}
with the ID of your container.
For detailed descriptions of all the parameters used here, and many other customization options, see the OpenID Connect parameter reference.
Navigate to your
kong.conf
file.With RBAC enabled, add the
admin_gui_auth
andadmin_gui_auth_conf
properties to the file.Provide your own values for all fields indicated by curly braces (
{}
):enforce_rbac = on
admin_gui_auth = openid-connect
admin_gui_auth_conf = {
"admin_claim": "email",
"client_secret": ["{CLIENT_SECRET}"],
"authenticated_groups_claim": ["{CLAIM_NAME}"],
"ssl_verify": false,
"leeway": 60,
"redirect_uri": ["{YOUR_REDIRECT_URI}"],
"login_redirect_uri": ["{YOUR_LOGIN_REDIRECT_URI}"],
"logout_methods": ["GET", "DELETE"],
"logout_query_arg": "logout",
"logout_redirect_uri": ["{YOUR_LOGOUT_REDIRECT_URI}"],
"scopes": ["openid","profile","email","offline_access"],
"auth_methods": ["authorization_code"],
"admin_auto_create_rbac_token_disabled": false
}
For detailed descriptions of all the parameters used here, and many other customization options, see the .