Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix: record the password credential on successful password logins (ovcs) - #4226

Merged
BelSequent merged 4 commits into
ovcsfrom
fix/meta-13862-typed-success/ovcs
Nov 13, 2026
Merged

BelSequent merged 4 commits into
ovcsfrom
fix/meta-13862-typed-success/ovcs

Conversation

@BelSequent

@BelSequent BelSequent commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Keycloak 26.7 clears a user's brute-force failures after a successful login only when the login recorded a counted credential type. The multi-attribute password authenticators (browser form and direct grant) and UsernamePasswordFormWithExpiry called context.success() without one, so on ovcs (Keycloak 26.7.0) a correct login through them no longer resets the user's failure count. They now call context.success(PasswordCredentialModel.TYPE), as Keycloak's own UsernamePasswordForm does; UsernamePasswordFormWithExpiry records none when its disablePassword option skips the password check. MessageOTPAuthenticator is unchanged: it checks its own message code, not a Keycloak credential.

Same change as C28's release PRs (#3577 for 10.0, #3739 for 10.1). Found on a 10.1 env with Keycloak 26.7.5: after one wrong PIN on a shared date of birth, a correct login left the voter at one failure.

Validation: the browser and direct-grant test classes check the typed success on a correct login, and a new UsernamePasswordFormWithExpiryTest covers the form; CI runs the Java tests. Merges cleanly with C26's open ovcs PR (#4110) in either order, and no test expects the untyped call after that merge.

Related: https://github.com/sequentech/meta/issues/13862

🤖 Generated with Claude Code

Keycloak 26.7 clears a user's brute-force failures after a login only when
the login recorded a counted credential type (password, OTP, recovery
codes): AuthenticationManager.logSuccess passes the credentials the flow
recorded through context.success(type), and DefaultBruteForceProtector
.successfulLogin returns without clearing when there are none. 26.6.1
cleared them for an untyped success too.

MultiAttributePasswordAuthenticator, its direct-grant variant and
UsernamePasswordFormWithExpiry check the password and then called
context.success(), so a correct login through them no longer reset the
voter's failure count: found on a 26.7.5 env, where a voter who had mistyped
a PIN stayed at one failure after logging in. They now call
context.success(PasswordCredentialModel.TYPE), as Keycloak's own
UsernamePasswordForm and ValidatePassword do. success(String) exists on
26.6.1 as well.

MessageOTPAuthenticator is left as is: it checks a code sent by message
against its own credential model, not Keycloak's OTP credential, and
records no brute-force failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 2

  • release/10.0
  • feat/meta-12767/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

BelSequent and others added 3 commits November 12, 2026 12:46
UsernamePasswordFormWithExpiry skips the password check when its
disablePassword option is on, but still reported a password login through
context.success(PasswordCredentialModel.TYPE). Conditional-credential
steps and brute-force accounting read the credential type a login
recorded, so that login looked like one that had checked a password. The
form now records the password only when it checked one, and calls
context.success() otherwise.

The Direct Grant tests' failure and lockout paths check again that the
no-argument success() isn't called either, besides success(any()).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BelSequent
BelSequent merged commit 1006108 into ovcs Nov 13, 2026
66 checks passed
@BelSequent
BelSequent deleted the fix/meta-13862-typed-success/ovcs branch November 13, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant