I am trying to achieve the following Browser Authentication flow in Keycloak (Version 26.4.7). Users usually should use the external Identity Provider (Google Workspace).
But it is possible that the user can access realms/my-realm/account/ and set a password, 2FA-methods or a passkey. If the user set’s a password, a second factor (2FA) should be provided for authentication. If the User sets a Passkey (passwordless, webauthn-passwordless) nothing more is required for authentication.
- If the user uses the external IdP (Google Workspace) authenticate the user.
- If the user provides a username and password, ask for a second factor (Authenticator, Recovery-Codes or Passkey as
webauthn-authenticator) - If the user logs in via Passkey (
webauthn-passwordless) authenticate him without 2FA.
All methods work so far, but if i login via Passkey (webauthn-passwordless) i always get asked for 2FA! And i can’t figure out how to configure the Browser flow to not ask for a second factor with Passkey for the live of me!
I duplicated the browser Authentication flow to browser-2fa, bound it to “Browser flow” and made the following changes:
- Conditional 2FA is set to
Required- Condition - user configrued is default (
Required) - Condition - credential is default (
Rrequired)- Credentials is
webauthn-passwordless(this is also default) - Included is
Off(also default)
- Credentials is
- Step OTP Form (
auth-top-form) is set toAlternative - Step WebAuthn Authenticatior (
webauthn-authenticator) is set toAlternative - Step Recovery Authentication Code Form (
auth-recovery-authn-code-formis set toAlternative
- Condition - user configrued is default (
As far as i understand the flow, the Condition - credential checks if a Passkey (webauthn-passwordless) is used and due to Included Off should return false (from the Tooltip: “… If this option is false (which should read Off), the condition is evaluated in the opposite way, it will be true if none of the credentials configured have been used, and false if one or more of them have been used.“) as “one or more” of the provided credentials is used with a Passkey and the whole flow Conditional 2FA should not be executed! But apparently this is not the case. What do i miss here?
