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

Multi-Factor Authentication #3383

Merged
merged 25 commits into from
Aug 29, 2023
Merged

Multi-Factor Authentication #3383

merged 25 commits into from
Aug 29, 2023

Conversation

pennersr
Copy link
Owner

Introduces allauth.mfa -- adding support for MFA.

@pennersr pennersr marked this pull request as draft August 23, 2023 19:08
@coveralls
Copy link

coveralls commented Aug 23, 2023

Coverage Status

coverage: 91.472% (+0.2%) from 91.319% when pulling 56926de on feat-mfa into 437cb65 on main.

@ryanhiebert
Copy link
Contributor

This is very exciting, and I expect that I'll be trying to implement it. I'll note one thing for your consideration: we would like to be able to require 2FA, except when the user logs in via a SAML SSO integration, so if it were convenient to make that possible via a hook or signal or something, I know that would be helpful for what we'd like to be able to do.

@pennersr
Copy link
Owner Author

There are multiple ways to force users to turn on 2FA. Forcing it right away may be a bit harsh, as when the user signs in for the very first time he is immediately confronted with 2FA technicalities without having ever seen the rest of the site. So, you might want to set a deadline within which the user needs to turn it on. All in all, whatever you do/choose here is a bit project specific, so that really is up for you to decide. You could for example setup a middleware of your own that, whenever the user does not have turned on 2FA and the deadline is passed, a redirect to the 2FA setup pages take place. Also, this PR includes the concept of login stages where you can intervene in the login pipeline. So there are already multiple ways of implementing what you need.

@pennersr
Copy link
Owner Author

Also, wondering, wouldn't it be better to require 2FA over at the SAML Identity Provider instead, instead of within your own Django project?

@ryanhiebert
Copy link
Contributor

Also, wondering, wouldn't it be better to require 2FA over at the SAML Identity Provider instead, instead of within your own Django project?

Yes, that's precisely our use-case. We want to be able to require 2FA (and in our case forcing immediate enrollment is desired), unless they are logging in with SSO where we will rely on the SSO provider to maintain those types of controls instead.

@pennersr pennersr merged commit 740cc88 into main Aug 29, 2023
22 checks passed
@akx
Copy link
Contributor

akx commented Sep 4, 2023

sad django-allauth-2fa maintainer noises

@pennersr pennersr deleted the feat-mfa branch October 13, 2023 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants