---
title: "Customize token Claims"
canonical: "https://onesaitplatform.refined.site/space/DOCT/2220847130/Customize%20token%20Claims"
format: markdown
---
Remember that user entities in the platform have an optional attribute called extraFields, where you can put a JSON value with custom information.

This attribute can be used to enhance the JWT token (aka token claims).

For example, suppose that we have a user with the following information:


```
{
  "username": "developer",
  "mail": "developer@onesaitplatform.com",
  "fullName": "A Developer of the Platform.",
  "role": "ROLE_DEVELOPER",
  "created": "19/05/2021",
  "updated": "27/05/2021",
  "active": true,
  "extraFields": "{\"organization\":\"myorganization\",\"postalCode\":28080,\"affiliations\":{\"soccer\":\"Real Madrid\"}}"
}
```


Organization, postalCode and affiliations can be released in the JWT claims.

To do so, head to the Keycloak administration console (i.e. [https://{DNS}/auth](https://development.onesaitplatform.com/auth) ), log in as an administrator user, and go to the realm’s configuration → client scopes → openid

![image](media://5ac7aa61-d786-4aac-a4cc-5346ee44d9f3)

![image](media://3bb13c07-debd-4b2c-a0e8-c0319b0806f1)

Now go to mappers and click on “create”.

Fill the form with the attribute name, in this case “organization”, and select JSON as Claim JSON Type:

![image](media://a5c78ccf-d109-4c2e-bd00-cde75ac09aac)

Repeat the process for the remaining attributes.

![image](media://619805ac-c6ce-4d98-af0c-29ed860786be)

![image](media://4ca6928d-3b88-48c7-8320-55ddab95b8ae)

Now, when the token is generated for every user, the IM will try to load these claims if present on the extraFields user’s attribute.

![image](media://d82f7ae1-9344-47e4-bf58-1c59cd772e10)