-
Notifications
You must be signed in to change notification settings - Fork 13
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
Two-factor authentication support #388
Conversation
Codecov Report
@@ Coverage Diff @@
## main #388 +/- ##
============================================
- Coverage 36.92% 35.19% -1.74%
- Complexity 1059 1120 +61
============================================
Files 175 183 +8
Lines 3967 4325 +358
============================================
+ Hits 1465 1522 +57
- Misses 2502 2803 +301
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Open questions where I would appreciate input: Do we want to reset 2FA during recovery process?
If we have support for 2FA backup codes, we could argue that users have to use them if they loose their 2FA device. Do we want admins to be able to reset 2FA for accounts?
Again, with 2FA backup codes we could say that users have an option to restore 2FA themselves. Do we want to prod users to enable 2FA during login?The only problem I see is that users might be overwhelmed by all the security-relevant information they need to store somewhere:
That's not exactly a nice onboarding experience, is it? 🤔 |
fe77c84
to
c033826
Compare
Thanks for your awesome work. I haven't looked at the code yet, but I would like to provide some input for your questions:
Yes. Recovery process is like a fresh start for your account. There'll be no more mails inside. It just makes sense to also clear the 2FA token.
That's how it is commonly done and i think, it's a sensible thing to do. Especially for domain admins it'll be helpful. They can assist, but not give them selves access.
From the example I guess you're talking about signup, not login. Then my anwser: Not yet. I agree, that the onboarding experience would be degraded. Also, 2FA is not that common to regular end-users. In general, I'm a bit worried about confusing users with additional backup codes. But I also don't think it's possible to get rid of 2fa backup codes as you don't want to reset your whole mail account when you lose your phone. What do you think about the following idea? When a user inserts their recovery code, give them them the choice to just delete their 2FA token or reset the whole password (and clear inbox). |
ba74e57
to
c6985b2
Compare
Support for backup codes is now implemented (and covered by behat tests). Six backup codes are generated automatically during twofactor configuration. The user is asked to acknowledge that they stored the backup codes at a secure place. Only afterwards twofactor authentication is enabled. |
That's wrong. Recovery process restores your account along with all the content.
We decided against resetting 2FA configuration with the recovery process for now. Otherwise, we would compromise the security of two-factor authentication. Being able to reset both your password and your two-factor secret using the recovery token (regardless whether it's two options in the process or one) means that one factor (recovery token) is enough to reset both factors of your account. That's not a good idea IMHO. |
Allows to enable TOTP-based twofactor authentication and display QR code via TwofactorController routes. Enforces TOTP verification for users that have a TOTP secret stored. Displays TOTP status in admin interface.
Fixes behat tests.
* Test enabling two-factor auth until verification * Test that login with enabled two-factor auth requires token
Six backup codes are generated automatically during twofactor configuration. The user is asked to acknowledge that they stored the backup codes at a secure place. Only afterwards twofactor authentication is enabled.
13d6312
to
8738416
Compare
Adds support for TOTP-based two-factor authentication.
Overview
Fixes: #115
Screenshots
Enabling two-factor authentication in account settings
Settings overview
2FA settings, 2FA not enabled
2FA settings, enabling 2FA
2FA settings, enabling 2FA, invalid token
2FA settings, 2FA enabled
Two-factor form during login