Skip to content
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

Add more custom information to the JWT #676

Closed
leroy0211 opened this issue Mar 21, 2018 · 5 comments
Closed

Add more custom information to the JWT #676

leroy0211 opened this issue Mar 21, 2018 · 5 comments

Comments

@leroy0211
Copy link

Is there any way of adding custom public claims to the JWT instead than the defaults?

Currently the payload of the JWT holds the default claims aud, jti, iat, nbf, exp, sub, and a single single custom public claim scopes. But what if we want the first name to be added to the JWT claims too?

As described in the documentation: https://tools.ietf.org/html/rfc7519#section-4.2

@genyded
Copy link

genyded commented Mar 27, 2018

Yes - please consider this! Without this is requires 2 API calls (one to get the token and one to get the user info) when if the payload had the ability to contain the user info only one API call would be needed. Additionally almost all other Passport/JWT implementations support this.

One of the key points for using this is to be able to pass custom data in the token.

@atrauzzi
Copy link

atrauzzi commented Jul 2, 2018

Yeah, this is definitely needed so that I can add organization and tenant information as claims to the token. There's no real way in a stateless situation to pull that information up correctly without putting the information elsewhere on the wire.

@ali-syria
Copy link

This feature is really needed,
My use case , access token for mobile application should include mobile device id , so for example when user log out from mobile app ,server just stop push notification for just that mobile

@driesvints
Copy link
Member

Going to close this as it's a duplicate of #94.

@fredsal
Copy link

fredsal commented Apr 20, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants