Search code examples
django-allauth

How To Use New Django Allauth MFA


I've got a project which utilises Django Allauth. I saw they recently released MFA within Django Allauth, but I have no idea how to implement it, and the documentation is fairly limited at the moment.

Can anyone explain what the steps are to implementing the Django Allauth MFA in a bit more detail?

Thanks for any help anyone can offer!


Solution

  • It's quite simple.

    You need to pip install django-allauth[mfa]

    You add it to settings.py apps as allauth.mfa

    Also include this setting: MFA_ADAPTER = "allauth.mfa.adapter.DefaultMFAAdapter"

    then run python manage.py migrate

    if you go to localhost/accounts/, you would see a list of all the available url django-allauth offers.

    At the bottom, you should see "accounts/2fa". If you navigate to localhost/accounts/2fa, then you would see that it is set up. You need to configure your signups to redirect to that page to take advantage of it.