Repository navigation
Recovery authentication codes #8518
Replies: 9 comments 31 replies
|
Milestones should probably be removed. I presume "Recovery codes display and download screen" isn't the final product? |
|
I like that this proposal contains a detailed description and screenshots. Makes it easier to think through and provide feedback 👍 My notes on UI/UX:
|
|
Thanks for the thoughts and the PoC!! I really like the feature! I agree with @jbman that the user should be able to enter any of the backup-codes. Maybe a way to know which code the user entered could be a list like this:
And then extracting the first two digits. This would increase the length of a backup code . Or we do it like in https://groups.google.com/g/keycloak-dev/c/SC1JvewgLwM/m/pIAS4-9pAwAJ and just try every code with a reduced number of iterations. Thanks for your work! |
|
@rh-iatanaso thanks for putting this together, very concise and easy to understand proposal. I'm curious about the statement below: "When a user is prompted to authenticate the recovery authentication codes should be available as an option if already has another 2FA method configured. If OTP is disabled the user will be able to authenticate only with recovery authentication codes" Let's think about the following malicious user story: Please correct me if I'm wrong, but it seems that the adversary should be able to log in with the recovery authentication code, disable OTP and lock the user outside the app. Is that correct? |
|
Great work and great proposal so far, thanks for that! I just try to get my head around the "Allow users to use recovery code as primary 2FA" - Part. Could you clarify that a bit? disclaimer: The following is more a "stream of conciousness" with a few questions inside from my side w.r.t. using the codes as primary 2FA: I imagine a user has not setup 2FA yet, but creates recovery codes (thus, leading to 2FA enabled for the login flow). potential options of "what happens" i think of: option 1: user gets noticed to re-create new codes (or setup an MFA device) before the codes are completely gone? option 2: user gets no notice, and has to reset his/her account after using the 15 codes. option 3: make the usage of recovery codes dependant on having set up a 2FA Generator/APP at least once So, as said, great work so far. Would be great if you could clarify the question :) |
|
Few more points from me besides what was already told here:
|
|
This looks good and is much more idiomatic than my initial implementation :) Some remarks about how we currently use the original backup code implementation:
Regarding the generated codes:
|
|
The round of changes after review that affects the features include:
Everything else is a refactoring. See #8730 for full discussion. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Support for recovery authentication codes
Motivation
The base work around multi-factor authentication is defined in multi-factor-admin-and-step-up.md. However users need an easy alternative means of authentication if they are unable to generate a one time token. Currently, users with 2FA enabled who do not have access to the device configured with an authenticator application must reset their password, which disables 2FA and allows the user to authenticate. In the event that the user’s email account has been compromised, this renders 2FA useless as an attacker can reset the password, disabling 2FA, allowing access to the user’s account.
We would like to propose a solution which will deliver a functionality to generate recovery authentication codes that can be printed or stored in a safe location. Those recovery authentication codes can then be used when none of the other forms of second factor authentications are available, or potentially they can be used as a second factor authentication on their own. Quite a few of the authentication providers and websites have features that deliver similar functionality.
Use Cases
Design Proposal
Recovery codes will be configured as part of the Authentication flow.
Following requirements will be followed:
Implementation details
In order to enable the recovery codes the server administrator will register the ‘Required Action’ through the Realm > Authentication -> Required Action and enable the feature.
Information about recovery authentication codes will be available when managing users in the realm at Realm > Manage -> Users -> User -> Credentials. There will be a specific credential type. The number of remaining recovery codes will be available in the Data section.
The user will be able to create or remove recovery codes under the Two-Factor authentication section in the account console. The section will show the number of recovery codes available as well as the date that the recovery codes were generated. Notification messages will be displayed if the number of recovery codes left is under 3.
When a user is prompted to authenticate the recovery authentication codes should be available as an option if already has another 2FA method configured. If OTP is disabled the user will be able to authenticate only with recovery authentication codes.Specific recovery code number will be requested. Those would be requested in sequential order starting from 1.
UI Screens
For simplicity few screens can be found below.
Account console
Admin Console
Admin console >> User management
Database changes
There will be no database changes required. We are using the CredentialModel to store the credentials.
Resources
Notes
Recovery Codes entropy
Comparing to others:
All reactions