This repository has been archived by the owner on Dec 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Allow more robust JWT enrichment #29
Comments
com4
added a commit
to com4/django-oauth-toolkit-jwt
that referenced
this issue
Dec 23, 2020
- Adds Oauth token `content`, oauth2_provider's `token_obj` model, and django-oauth-toolkit-jwt's `current_claims` as parameters to `JWT_PAYLOAD_ENRICHER`. This will give the user more control over the data that is included in their JWT - Add `JWT_PAYLOAD_ENRICHER_OVERWRITE` setting (default is False). Setting this to true will allow the user total control over the claims included. Fixes humanitec#29
com4
added a commit
to com4/django-oauth-toolkit-jwt
that referenced
this issue
Dec 23, 2020
- Adds Oauth token `content`, oauth2_provider's `token_obj` model, and django-oauth-toolkit-jwt's `current_claims` as parameters to `JWT_PAYLOAD_ENRICHER`. This will give the user more control over the data that is included in their JWT - Add `JWT_PAYLOAD_ENRICHER_OVERWRITE` setting (default is False). Setting this to true will allow the user total control over the claims included. Fixes humanitec#29
com4
added a commit
to com4/django-oauth-toolkit-jwt
that referenced
this issue
Jan 8, 2021
- Adds Oauth token `content`, oauth2_provider's `token_obj` model, and django-oauth-toolkit-jwt's `current_claims` as parameters to `JWT_PAYLOAD_ENRICHER`. This will give the user more control over the data that is included in their JWT - Add `JWT_PAYLOAD_ENRICHER_OVERWRITE` setting (default is False). Setting this to true will allow the user total control over the claims included. Fixes humanitec#29
com4
added a commit
to com4/django-oauth-toolkit-jwt
that referenced
this issue
Jan 8, 2021
- Adds Oauth token `content`, oauth2_provider's `token_obj` model, and django-oauth-toolkit-jwt's `current_claims` as parameters to `JWT_PAYLOAD_ENRICHER`. This will give the user more control over the data that is included in their JWT - Add `JWT_PAYLOAD_ENRICHER_OVERWRITE` setting (default is False). Setting this to true will allow the user total control over the claims included. Fixes humanitec#29
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I would like a way to make a more robust JWT modeling some of the claims after OIDC (though not completely compliant). To do this I need access to user information. Currently the
token_enricher
function is passed only therequest
object but it doesn't contain any user information since the user is not logged in.I propose passing all known information to the
token_enricher
function and letting the user decide exactly what's included in the token. For example:This would allow for user functions that look more like this:
This implementation "works for me" but it may break backward compatibility with existing enrichment functions that accept a single named parameter (this should be fixed in the future by updating the documentation to accept
**kwargs
as in the above example).I've opened a pull request (#30) if this is something others would find value in.
The text was updated successfully, but these errors were encountered: