8000 Log out other sessions only after the passkey is saved by marsluca · Pull Request #54776 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Log out other sessions only after the passkey is saved - #54776

Open
marsluca wants to merge 1 commit into
keycloak:mainfrom
marsluca:webauthn-register-logout-after-success
Open

marsluca wants to merge 1 commit into
keycloak:mainfrom
marsluca:webauthn-register-logout-after-success

Conversation

@marsluca
@marsluca marsluca commented Nov 6, 2026
Copy link
Copy Markdown
Contributor

Closes #54352

WebAuthnRegister.processAction logged out the other sessions before it parsed and verified the attestation, so a failed registration still ended them. I moved the logout to right after createCredential, so it only runs once the passkey is saved. This also covers the passwordless register action, which extends this class.

Testing:

  • New test AppInitiatedActionWebAuthnTest#failedSetupWebAuthnKeepsOtherSessions: two sessions, "sign out other devices" checked, and an invalid attestation object, so the server rejects the registration. It checks that both sessions are still there. It fails on main (2 sessions become 1) and passes with the fix. It also runs in AppInitiatedActionPwdLessTest and AppInitiatedActionWebAuthnSkipIfExistsTest.
  • I ran those three classes (13 tests) on headless Chrome, plus the tests/webauthn module (71 tests), locally.

AI-assisted (Claude Code).

WebAuthn registration logged out the user's other sessions before it
checked the attestation. When the registration failed, the other
sessions were gone anyway. The logout now runs after the credential
is created.

Closes keycloak#54352

Signed-off-by: Luca Marsella <34103646+marsluca@users.noreply.github.com>
@marsluca
marsluca requested review from a team as code owners November 6, 2026 15:51
Copilot AI balanced review requested due to automatic review settings November 6, 2026 15:51
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed WebAuthn Registration Revokes Other Sessions

2 participants

0