You can configure the OIDC plugin to use Kong Identity as the identity provider for your Gateway Services. In this example, you’ll apply the plugin to the control plane globally, but you can alternatively apply it to the Gateway Service.
First, get the ID of the quickstart control plane you configured in the prerequisites:
curl -X GET "https://us.api.konghq.com/v2/control-planes?filter%5Bname%5D%5Bcontains%5D=quickstart" \
--no-progress-meter --fail-with-body \
-H "Authorization: Bearer $KONNECT_TOKEN"
Export the control plane ID:
export CONTROL_PLANE_ID='YOUR-CONTROL-PLANE-ID'
Enable the OIDC plugin globally:
curl -X POST "https://us.api.konghq.com/v2/control-planes/$CONTROL_PLANE_ID/core-entities/plugins/" \
--no-progress-meter --fail-with-body \
-H "Authorization: Bearer $KONNECT_TOKEN"\
-H "Authorization: Bearer $KONNECT_TOKEN"\
-H "Content-Type: application/json" \
--json '{
"name": "openid-connect",
"config": {
"issuer": "'$ISSUER_URL'",
"auth_methods": [
"bearer"
],
"audience": [
"http://myhttpbin.dev"
]
}
}'
In this example:
-
issuer: Setting that connects the plugin to your IdP (in this case, Kong Identity).
-
auth_methods: Specifies that the plugin should use bearer for authentication.