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

How do I customize django-two-factor-auth for existing REST API for login #576

Open
Pal-Sandeep opened this issue Dec 20, 2022 · 1 comment
Labels

Comments

@Pal-Sandeep
Copy link
Member

I am currently using REST API for user login. Now want to add two factor authentication to my existing Login api.
In django-two-factor-auth there are views provided by default, and I want to customize them according to my API response.

@andrelccorrea
Copy link

I was able to integrate with DRF, using token authentication.
There are several caveats, but it is possible.
I needed to create a custom auth class, create a custom permission class, change the login view and create the setup and 2FA verification, refresh and backup tokens listing views.

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

No branches or pull requests

3 participants