Skip to content
English
  • There are no suggestions because the search field is empty.

Enrich JWT claims with user context and ensure DID key

POST /api/v1/auth/claims-enrichment Select code sample Fetch cURL
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 attributes

Keycloak user attributes

object key additional properties string email string groups

Keycloak groups

Array name string picture string provider

IDP provider type (e.g., “auth0”, “keycloak”)

string user_id string
Example 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 properties
Example generated
{  "custom_claims": {    "additionalProperty": "example"  }}

400

Section titled “400 ”

Bad request - Invalid request body

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

401

Section titled “401 ”

Unauthorized - Invalid API secret

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

500

Section titled “500 ”

Internal server error

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}
Previous
Get JSON Web Key Set for token validation
Next
Exchange or refresh an access token