-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get custom claims included in JWT #446
Comments
Name is a "well known" oidc claim according to https://github.com/authts/oidc-client-ts/blob/707435fe6c226a3f8a861873a7c27eaa492faa04/src/Claims.ts#L39 - I wonder if that is interfering with things? Our solution includes a custom tenantGid claim in the identity token (and also the access token) and we're able to retrieve it using (yes, the
So I know that this library (probably actually oidc-client-ts) can retrieve custom claims from the identity token and put them on the user profile object. |
@dantheother thank you for the response. I had been checking the access token this entire time which contained the field, but when I checked the id token I noticed it was missing. |
Hi, have there been any updates recently that might address auth.user.profile.name not being present even when name is present in the access_token? Thanks! |
@djohnsonkc profile is populated from the identity token, not the access token. Identity token is for use on the client, access token is for use on the server. |
Would the user's name be available now somewhere other than in auth.user.profile.name? Thanks. |
I am getting a JWT token that includes a custom field in the payload called name. When I view the results of
useAuth()
, stored in a variable calledauth
, I can see the user object which contains the profile object where I would expect the name to be, except the name field is not there. When I decrypt the token stored in auth I can see the name field just fine. Am I supposed to access the name using a different method other thanauth.user.profile.name
?An example of how the payload is setup is
The text was updated successfully, but these errors were encountered: