Repository navigation
Conversation
Locking a property no longer disables the whole account: the counter for that identifier is blocked while every other identifier keeps working, so a user locked out by email can still authenticate by phone number. Resolve the attempted identifier through the protected properties as well, otherwise a login by phone number could not be matched to a user, and clear the per-identifier and per-channel counters on success. Signed-off-by: Hockenba <github@opalpine.com>
A property counter blocks a single identifier and deliberately leaves the user record enabled, so neither isEnabled() nor the account-wide isTemporarilyDisabled() check in updateUser() noticed it. The Admin Console unlock switch therefore reported success without clearing the counter. Also drops the per-property lookup helpers left unused by the admin API.
Temporary locks already surfaced through failedLoginNotBefore; this asserts ui-ext reports disabled for permanent identifier lockouts.
- Fall back to the username counter when no protected property matches the attempted identifier, and always protect the username under the properties policy - Look up at most two users per protected property and support several users sharing a value when recording failures - Use the identifier-aware lockout checks in IdentityBrokerService and DefaultUserProfile - Remove property counters when a user is deleted or a protected attribute value changes, unless the value is still used
Hockenba
force-pushed
the
independent-auth-brute-force-protection
branch
3 times, most recently
from
October 16, 2026 15:58
da765e4 to
f8f74bd
Compare
# Conflicts: # testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/CIBATest.java
Hockenba
force-pushed
the
independent-auth-brute-force-protection
branch
from
October 19, 2026 18:49
3c4f652 to
6b29bf7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brute force detection currently keys every failure on the user id, so five failed attempts against one identifier lock the whole account. This adds an optional policy that keys failures on the identifier the user actually submitted.
A new realm Lock policy selects the behavior:
Properties can be built-in (
username,email) or any custom user profile attribute, configured in Lock by user properties under Realm settings > Security defenses. Reaching the threshold for one identifier blocks only that identifier, so a locked email still leaves username and phone number usable.Identifier lockouts are enforced across the login form, direct grant, CIBA
login_hint, and SAML ECP, and the Admin Console users list and user details report them. Unlocking a user clears the identifier counters for that user.Because a property counter belongs to the property value rather than to an account, the documentation calls out that users sharing a value share the counter, and that changing a value does not migrate it.
When contributing this upstream, add
Closes #<issue>here (Keycloak requires a GitHub issue per PR).