How do I check the scopes being passed in the token payload?
For troubleshooting or debugging purposes, you may want to check the scopes being passed in the payload.
The signed JWT access token you receive in the response is composed of three parts, each separated with a dot (.
) character: $HEADER.$PAYLOAD.$SIGNATURE
.
The payload portion contains the scopes information, encoded in base64 format.
Decode the payload in any tool you prefer. For example, you can use base64 and jq:
jq -n --arg p "$PAYLOAD" '$p | @base64d | fromjson'
The response will contain data about the user, including the scope:
"scope": "openid profile email",
"email_verified": false,
"preferred_username": "alex"
How can I check that I’m able to connect to my IdP?
If you’re running a self-managed Kong Gateway instance, you can check that the OpenID connect plugin is able to access the issuer URL with the /openid-connect/issuers/
endpoint:
curl http://localhost:8001/openid-connect/issuers
The results should contain the Keycloak OpenID Connect discovery document and keys. If the results only show the issuer URL and ID, then the connection was unsuccessful.