Repository navigation
Create authentication flow with mandatory 2FA with OTP or WebAuthn #14988
|
Hi, KeyCloak comes with default browser authentication flow with OTP 2FA How to add an additional WebAuthn Authenticator execution as alternative to OTP, but continue with mandatory 2FA? I tried to add WebAuthn Authenticator in same level of OTP, and changed both to "Alternative", this works since user has one of them configured, but to new users the authentication fails with log I'm trying to understand the execution |
Replies: 8 comments 30 replies
|
Hi! I think I found a way to this. Added this flow below Some tests, looks OK. If someone can points any problem with this, or have a better way, please share. |
|
I filed a similar question. The difference is, that both second factors should be enforced to be configured: #19548 |
|
Question was discussed, amongst other things, 4 years ago, here. db |
|
This works nicely enough for me. I've configured OTP, WebAuthn, and Recovery Codes all as alternatives. I've required recovery code registration as a default required action in the realm, and in our case, administrators will need to assign OTP or WebAuthn as a required action for new users. This shouldn't be a problem in our case. Thanks for the ideas! |
|
I want to develop a user authentication flow and need guidance on setting it up correctly. Currently, my process requires users to log in with a username and password, followed by a TAN (Transaction Authentication Number) sent to their email for further verification. I want to implement an optional feature where users can choose to register for a Web Authenticator instead of receiving a TAN. When a user opts for the Web Authenticator, the TAN verification step should automatically be skipped. However, I'm encountering problems with the configuration: When OTP and TAN are set as alternatives: The system fails to bypass the TAN step for users who are registered with the Web Authenticator, which it should ideally do. But it is also Bypassining the OTP step for registered Users with Web Authenticators. When I set OTP as required and TAN as an alternative: If the user has neither method configured, the system either forces them to register upon login (which we want to avoid), or it fails to function correctly (i.e., does not authenticate them at all). I need the Web Authenticator to be a voluntary, non-mandatory option that, when used, eliminates the need for TAN verification. How can I configure the system to: Allow users to choose the Web Authenticator without making it mandatory? |
|
the workflow I was trying to accomplish was to "prefer" webauthn over OTP for users that have both set up. the solution was to, as an admin, drag webauthn over OTP on the user's credential page - very unfortunate that this is not something the user can do, but I can probably count on one hand the number of users that would prefer this. |
|
Given a flow where 2fa is conditional upon having a 2fa credential
configured, what prevents a user from getting logged in, setting up their
2fa as required, but then deleting that 2fa credential through the account
console? Then their subsequent logins would not require 2fa, because they
no longer have a 2fa credential configured.
|
|
I did want to reply to a thread, and messed the email up. Thanks for being
understanding, and thanks to all for responding. I thought I'd tried
something exactly like this and found a reason it wouldn't work for me.
I'll investigate that again. Thanks again.
…On Mon, Aug 5, 2024 at 11:41 AM darius-m ***@***.***> wrote:
I assume you wanted to reply to one of the threads? Regardless, the
condition would indeed make the requirement of MFA not applicable. However,
if the OTP is set to "Required" as the only step in an alternative subflow,
when none of the alternatives can be applied, the "required" step is
enforced.
Let's consider the following flow:
- Username and Password (required)
- MFA (required subflow)
- TOTP (alternative subflow)
- OTP Form (required)
- WebAuthn Authenticator (alternative)
If the user has either OTP or WebAuthn configured, Keycloak will chose
that particular step for authentication. If neither are set, Keycloak will
enter the TOTP alternative flow, and since the "OTP Form" is set to
required, it will ask the user to configure TOTP. Adding a condition in the
"TOTP" flow would indeed disable both cases, and users would be unable to
log in (the "MFA" parent subflow would not be able to succeed, so if it's
set to required, the authentication flow would fail).
You can confirm whether this works as expected for your scenario.
—
Reply to this email directly, view it on GitHub
<#14988 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAON7N3N6T67QKUMR3MSITZP6TLPAVCNFSM6AAAAAARINSHP6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMRUGUZDAMI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi!
I think I found a way to this. Added this flow below
Username Password Form:Some tests, looks OK.
If someone can points any problem with this, or have a better way, please share.