-
Hi all, I saw that the django-allauth package recently introduced MFA, which is a great addition. However, I have no experience implementing MFA, and my project was generated with cookiecutter-django, so almost all of the Django-Allauth implementation I've got was generated automatically. Could someone give me a brief explanation on how to add MFA to my project and require users to log in with MFA? Or a link to a guide explaining how to add it would be fantastic too. The actual documentation on MFA seems pretty limited so far. Thanks for any help anyone can offer! EDIT: |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 7 replies
-
Is anyone able to advise on this please? |
Beta Was this translation helpful? Give feedback.
-
Ok no problem, thanks for answering! |
Beta Was this translation helpful? Give feedback.
-
please how can I set the issuer name for my 2FA? |
Beta Was this translation helpful? Give feedback.
-
Hi everyone. I’m working on a project that uses Django DRF as the backend and React.js as the frontend. The setup already incorporates django-allauth for Social Login (Google) and email/password authentication. Now, I’d like to enhance the security by integrating OTP (one-time password) functionality for user authentication. While I’ve found bits of documentation, I’m struggling to piece everything together. Here’s what I’d like to achieve:
Could anyone:
I really appreciate any insights or advice you can share. Thanks so much in advance for your help! |
Beta Was this translation helpful? Give feedback.
-
Confirmative. No additional libraries needed, see: https://docs.allauth.org/en/latest/headless/openapi-specification/#tag/Account:-2FA
See https://react.demo.allauth.org/ -- it shows all of allauth, including 2FA/TOTP, using a React app. Source is here: https://codeberg.org/allauth/django-allauth/src/branch/main/examples/react-spa |
Beta Was this translation helpful? Give feedback.
-
FWIW -- requiring additional input during signup is explained here: https://docs.allauth.org/en/latest/headless/faq.html |
Beta Was this translation helpful? Give feedback.
Requiring the user to use 2FA could be implemented in various ways. For example requiring the user to setup 2FA immediately at sign up, to limit certain functionality until 2FA is activated, to give the user a certain deadline before which 2FA should be activated, and so on. Given that there are multiple ways of tackling this requirement this is not something that is offered out of the box -- you will have to implement this yourself in your own project.