Validate the Token Claims
Obtain an end-user token and a database-access token from Keycloak, then validate their claims before configuring the database.
Verify the following:
-
Both tokens: The
issclaim matches the realm issuer, and the expiration time specified byexphas not passed. Verify each token’s signature using the public key from the realm’s JWKS endpoint. The JWT header’skididentifies the signing key. -
End-user token: The
audclaim includesords_client, thepreferred_usernameclaim identifies the user, and thesubclaim contains the unique user identifier. The top-levelrolesarray contains the user’s realm roles, such asEMPLOYEE. -
Database-access token: The
audclaim includesdb_app, andclient_idcontainsords_client. Thesubclaim identifies the service account and can differ from the client ID.
To preview the claims generated by your client configuration, see Client scopes evaluation in the Keycloak Server Administration Guide.
After validating the tokens, configure the database as described in Set Up IAM Integration for Application-Mediated Connections.