---
title: "Customize token Claims"
canonical: "https://onesaitplatform-es.refined.site/space/OP/1945567264/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://41ba183f-ad21-4e2c-b232-73dfcdc3c53e)

![image](media://cff0a1ed-a068-4a61-8fb6-bbf6635c050b)

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://ee1b9586-b2ca-46cc-b252-39ca53b158df)

Repeat the process for the remaining attributes.

![image](media://6d2b500f-2c71-4847-91df-39966436cd30)

![image](media://f17603e3-ba57-436f-a885-80c1884d7d86)

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://657b7592-2603-43b8-a7dd-5b7d26760fba)