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

Impersonation Token #103

Open
NiraliSupe opened this issue Oct 25, 2021 · 1 comment
Open

Impersonation Token #103

NiraliSupe opened this issue Oct 25, 2021 · 1 comment

Comments

@NiraliSupe
Copy link

Hello,

Thank you for the awesome token authentication plugin.

I need to implement the api where super user can become anyone and debug the issue.
I found the documentation on the token impersonation, however, It doesn't explain much on how to setup the api. Could you please provide more details on the same preferably example?
https://styria-digital.github.io/django-rest-framework-jwt/#impersonation-token

Please let me know if you need anything else.

Thank you

@creyD
Copy link

creyD commented Nov 10, 2022

This is properly documented, you just need to add from rest_framework_jwt.views import impersonate_jwt_token and a path to this to your urls.py and then you can sent a package with {'user': <USER_ID>} to the endpoint and you get an authentication token for the user with the USER_ID. Only works as a Django superuser of cause. If you need to make any adjustments to this config you can overwrite it at any point (Serializer, View etc).

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

2 participants