django-graphql-jwt icon indicating copy to clipboard operation
django-graphql-jwt copied to clipboard

Add SUB claim (subject) in settings and use it for token creation

Open cgranetgithub opened this issue 5 years ago • 2 comments

Firebase requires to pass sub (subject) in JWT token: https://firebase.google.com/docs/auth/admin/create-custom-tokens

Would be great to add it in settings and during token creation so that this package can be used with Firebase custom authentication.

cgranetgithub avatar May 23 '20 16:05 cgranetgithub

I have a similar requirement. You can add claims to your jwt by providing your own jwt payload handler in settings.

https://django-graphql-jwt.domake.io/en/latest/settings.html#jwt-payload-handler https://django-graphql-jwt.domake.io/en/latest/_modules/graphql_jwt/utils.html#jwt_payload

Shannanigans avatar Sep 17 '20 15:09 Shannanigans

To be honest I think this requirement is important enough that a larger portion of the docs could be dedicated to it. An example under Customizing is perhaps appropriate.

Shannanigans avatar Sep 17 '20 15:09 Shannanigans