How do I get custom Roles with OIDC and JWT

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…

{
  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?

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 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:

Hope this helps!

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