Enrich JWT claims with user context and ensure DID key
const url = 'https://localhost:8080/api/v1/auth/claims-enrichment';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"attributes":{"additionalProperty":"example"},"email":"example","groups":["example"],"name":"example","picture":"example","provider":"keycloak","user_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:8080/api/v1/auth/claims-enrichment \ --header 'Content-Type: application/json' \ --data '{ "attributes": { "additionalProperty": "example" }, "email": "example", "groups": [ "example" ], "name": "example", "picture": "example", "provider": "keycloak", "user_id": "example" }'Called by IDP Actions/Hooks to provision the user, return organization/project/role custom claims for the JWT, and create a DID key when one is missing
Request Body
Section titled “Request Body ”User information
object
Keycloak only; diagnostics only
object
Keycloak only; adds the groups claim
Defaults to auth0
Responses
Section titled “ Responses ”Custom claims to add to JWT (includes did_key_id if available)
The custom claims the IDP should add to the token it is minting
object
object
Example generated
{ "custom_claims": { "additionalProperty": "example" }}Bad request - Invalid request body
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Unauthorized - Invalid API secret
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Internal server error
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}