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 support for user based secret key #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

foodles-tech
Copy link

In order to address this issue :
#17

I propose the following solution:

  • Add a JWT_SECRET_KEY setting that should be used for hmac algorithm
  • The SIGNING_KEY and VERIFYING_KEY should be used only for asymmetric
    algorithm
  • Add a GET_USER_SECRET_KEY setting which expect a function that will
    be called with the user id as defined by the USER_ID_FIELD and return a
    key that can change for instance when the user changed his password

@foodles-tech foodles-tech force-pushed the add-support-for-user-based-key branch 5 times, most recently from af3785c to 7da2db2 Compare October 29, 2018 11:01
In order to address this issue :
jazzband#17

I propose the following solution:
- Add a JWT_SECRET_KEY setting that should be used for hmac algorithm
- The SIGNING_KEY and VERIFYING_KEY should be used only for asymmetric
algorithm
- Add a GET_USER_SECRET_KEY setting which expect a function that will
be called with the user id as defined by the USER_ID_FIELD and return a
key that can change for instance when the user changed his password
@foodles-tech foodles-tech force-pushed the add-support-for-user-based-key branch from 7da2db2 to 9996fe1 Compare October 29, 2018 11:08
@foodles-tech
Copy link
Author

@davesque This pr is now ready for review, sorry for the noise with the commits I pushed, I had trouble making the test pass, but now everything is fine.

@pkariz
Copy link

pkariz commented Feb 22, 2019

@davesque is this going to be merged? I need this feature and want to know whether i should create my own solution or wait for this one to be merged. Thanks in advance for the response

@Toruitas
Copy link

Yes, I would like to use this functionality as well.

@Afnarel
Copy link

Afnarel commented Apr 26, 2019

I would like this also, it would be very useful to be able to revoke access from the backend, unless there is a better way to do this?

@mariuccio
Copy link

mariuccio commented Apr 30, 2019

Yes, I need it here as well. It will be perfect also for a logout purpose.
I have seen you are discussing it here (#28).
Even because my app needs to respect GDPR that requires a logout feature.

On django-rest-framework-jwt I have seen it's possible to make it in this way
jpadilla/django-rest-framework-jwt#385 (comment)

@ghassett
Copy link

Here is another vote for the user-key-based logout functionality (similar to jpadilla/django-rest-framework-jwt#385 (comment)) . Any word on the possibility of merging this PR, @davesque?

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

Successfully merging this pull request may close these issues.

7 participants