Repository navigation
Passkey login still prompts for OTP when Realm Passkeys is enabled (#52809) #52876
Replies: 1 comment 1 reply
|
The dependency on the realm-level “Enable Passkeys” setting is a useful clue, but I would be cautious about changing
Keycloak has a separate Because of that, I would first verify whether the affected path is failing to:
The I would avoid adding this check directly to The proposed integration tests are useful. I would additionally cover an explicitly required OTP/step-up flow and a custom flow using Could the core-authentication team confirm whether the regression is expected to be fixed in credential recording, conditional-credential evaluation, or flow configuration? I would be happy to adjust the candidate patch once that behavior is confirmed. |
8000 Uh oh!
There was an error while loading. Please reload this page.
Analysis: When Realm-setting > Login > Enable Passkeys is ON (regardless of the WebAuthn Passwordless Policy's own Enable-Passkeys toggle), a user who authenticates via passkey still gets prompted for OTP afterward. This only reproduces when the realm-level toggle is on — turning it off (even with the policy-level toggle on) avoids the bug entirely, which points to the realm-level flag driving a different code path in determining whether the login already satisfied MFA.
My current hypothesis: the conditional OTP authenticator in the browser flow (ConditionalUserConfiguredAuthenticator) does not check whether the user's just-completed authentication was already a passwordless/passkey credential. It goes straight into evaluating the sibling executions in the flow, so even after a passkey login, OTP is still treated as required.
Candidate fix: in ConditionalUserConfiguredAuthenticator.matchCondition(), check AuthenticatorUtil.getAuthnCredentials(context.getAuthenticationSession()).contains(WebAuthnCredentialModel.TYPE_PASSWORDLESS) first, and if true, return false (i.e. the OTP condition is not matched, so the OTP step is correctly skipped) before falling through to the existing matchConditionInFlow(...) logic.
I'd like to confirm this diagnosis with the core-authn team before submitting a PR, since this issue is still in Refinement. I have a candidate fix + integration test ready locally covering: passkey login → OTP condition correctly skipped, and password login → OTP condition correctly still required. Happy to share the diff here for early feedback, or wait for confirmation on root cause first.
All reactions