jazzband / django-two-factor-auth

Complete Two-Factor Authentication for Django providing the easiest integration into most Django projects.
MIT License
1.67k stars 443 forks source link

Compatibility with django rest framework and react #354

Open noobmaster19 opened 4 years ago

noobmaster19 commented 4 years ago

Hello , i have been playing around with this application , its really good! However , as my project is going to be using react.js as the front end , i was wondering if it is compatible in such a project configuration , thanks!

moggers87 commented 4 years ago

It's possible, but you'd have to write your own login and setup views

andrelccorrea-blinctek commented 6 months ago

Any news on this subject? I'm also using the lib in the Django and Django Admin views. Now I'm studying a way to use it with DRF.

andrelccorrea commented 6 months ago

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.