Fixing Re-authentication with passkeys#1
Conversation
closes #41242 closes #41008 Signed-off-by: mposolda <mposolda@gmail.com>
This change modifies the method signature to require a UserModel parameter for proper user context validation during conditional passkey checks.
WalkthroughThis update refactors authentication logic around passkeys and re-authentication in the Keycloak authentication flow. It introduces utility methods for reauthentication error handling, encapsulates conditional passkey logic, and adds or updates several integration tests to verify passkey and re-authentication scenarios, including UI behavior and event assertions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant LoginForm
participant Authenticator
participant AuthUtils
participant WebAuthn
User->>LoginForm: Submit credentials
LoginForm->>Authenticator: authenticate(context)
alt User set & passkeys enabled
Authenticator->>WebAuthn: fillContextForm(context)
WebAuthn->>Authenticator: Return WebAuthn UI
else User set & passkeys disabled
Authenticator->>LoginForm: Skip username form
end
alt Error during re-authentication
Authenticator->>AuthUtils: setupReauthenticationInUsernamePasswordFormError(context)
AuthUtils->>LoginForm: Set USERNAME_HIDDEN, REGISTRATION_DISABLED
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (9)
🔇 Additional comments (27)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Test 1
Summary by CodeRabbit
New Features
Bug Fixes
Tests