{"repo":"xi/django-mfa3","free":true,"listed":false,"github":"https://github.com/xi/django-mfa3","clone":"git clone https://github.com/xi/django-mfa3.git","description":"multi factor authentication for django","language":"Python","stars":23,"topics":["django","fido2","two-factor-authentication","webauthn","mfa"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"django-mfa3 An opinionated Django app that handles multi factor authentication (MFA) via FIDO2, TOTP, and recovery codes. Features - Two factor authentication is required on login (if the user has registered a key) - Stuff just works without much configuration - The UI allows to add new keys and to remove keys that have been compromised - You can optionally enforce MFA for all users - You can (and should) customize the templates - Simple code, few dependencies Installation Usage 1. Add 'mfa' to INSTALLED APPS 2. Use mfa.views.LoginView instead of the regular login view. (Be sure to remove any other login routes, otherwise the multi factor authentication can be circumvented. The admin login will automatically be patched to redirect to the regular login.) 3. Set MFA DOMAIN = 'example.com' and MFA SITE TITLE = 'My site' . See settings.py for a full list of settings. 4. Register URLs: path('mfa/', include('mfa.urls', namespace='mfa') 5. The included templates are just examples, so you should replace them with your own 6. FIDO2 requires client side code. You can either implement it yourself or use the included fido2.js. 7. Somewhere in your app, add a link to 'mfa:list' Enforce MFA Optionally, you can add 'mfa.middleware.MFAEnforceMiddleware' to MIDDLEWARE (after AuthenticationMiddleware !). It will force users to setup two factor authentication by redirecting all authenticated requests to 'mfa:list' as long as the user has no MFAKeys. You can use mfa.decorators.public to add exce","default_branch":null,"files":null,"tree":[],"storefront":"/r/xi","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/xi/django-mfa3/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}