# How do I get custom Roles with OIDC and JWT

**URL:** <https://community.auth0.com/t/how-do-i-get-custom-roles-with-oidc-and-jwt/79421>\
**Category:** Get Help\
**Tags:** oidc, roles\
**Created:** [March 7, 2022, 7:36pm UTC](https://community.auth0.com/t/how-do-i-get-custom-roles-with-oidc-and-jwt/79421 "2022-03-07T19:36:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgleason](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jgleason/32/25904_2.png) [@jgleason](https://community.auth0.com/u/jgleason)\
**Post date:** [March 7, 2022, 7:36pm UTC](https://community.auth0.com/t/how-do-i-get-custom-roles-with-oidc-and-jwt/79421/1 "2022-03-07T19:36:13Z")

</div>

I am using OAuth2 Proxy to get the authorization header with the ID token and user information. However, I can’t seem to find the custom role I assigned to the user. My ID Token looks like this…

```auto
{
  given_name: '...',
  family_name: '...',
  nickname: '...',
  name: '...',
  picture: ...',
  locale: 'en',
  updated_at: '2022-03-04T16:27:13.490Z',
  email: '...',
  email_verified: true,
  iss: '...',
  sub: '...',
  aud: '...',
  iat: 1646679803,
  exp: 1646715803
}
{ alg: 'RS256', typ: 'JWT', kid: 'U1nTyZvTxgDY6f0FoV45X' }

```

How do I have it pass the roles?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 8, 2022, 12:04am UTC](https://community.auth0.com/t/how-do-i-get-custom-roles-with-oidc-and-jwt/79421/3 "2022-03-08T00:04:39Z")

</div>

Hey @jgleason welcome back!

Are you currently attempting anything to get them in there? You can add them as a custom claim via an Action, here’s a [sample](https://auth0.com/docs/manage-users/access-control/sample-use-cases-actions-with-authorization#add-user-roles-to-tokens) which I believe achieves exactly what you are looking for. If you’re interested please refer to the following blog blog post regarding adding custom claims to tokens with actions in general:

> **[Adding Custom Claims to ID Tokens with Auth0 Actions](https://auth0.com/blog/adding-custom-claims-to-id-token-with-auth0-actions/)**
>
> Learn how to create a new custom Action that will add a custom claim to your Auth0-issued ID Token

Hope this helps!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 23, 2022, 12:05am UTC](https://community.auth0.com/t/how-do-i-get-custom-roles-with-oidc-and-jwt/79421/4 "2022-03-23T00:05:30Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
