Enrich JWT claims with user context and ensure DID key
POST /api/v1/auth/claims-enrichment Select code sample Fetch cURL
name string
picture string
provider
Get JSON Web Key Set for token validation Next
Exchange or refresh an access token
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":"example","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": "example", "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
Media type application/json object attributesKeycloak user attributes
object key additional properties string email string groupsKeycloak groups
ArrayIDP provider type (e.g., “auth0”, “keycloak”)
string user_id stringExample generated
{ "attributes": { "additionalProperty": "example" }, "email": "example", "groups": [ "example" ], "name": "example", "picture": "example", "provider": "example", "user_id": "example"}
Responses
Section titled “ Responses ”200
Section titled “200 ”Custom claims to add to JWT (includes did_key_id if available)
Media type application/json object custom_claims object key additional propertiesExample generated
{ "custom_claims": { "additionalProperty": "example" }}
400
Section titled “400 ”Bad request - Invalid request body
Media type application/json object error string error_description stringExample
{ "error": "Unauthorized", "error_description": "Invalid token"}
401
Section titled “401 ”Unauthorized - Invalid API secret
Media type application/json object error string error_description stringExample
{ "error": "Unauthorized", "error_description": "Invalid token"}
500
Section titled “500 ”Internal server error
Media type application/json object error string error_description stringExample
{ "error": "Unauthorized", "error_description": "Invalid token"}
Previous Get JSON Web Key Set for token validation Next
Exchange or refresh an access token