You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I left a comment in UserAdapter.java flagging that writing this field on every login triggers cluster-wide cache invalidation for that user's cache entry on every single login — there's no existing precedent in core for a per-login write at that volume, and it may need a write-through path that bypasses cache invalidation before this is stabilized.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Enabling auditing can break valid logins for clients with URL-based IDs and read-only LDAP users through invalid profile attribute names and rejected attribute writes.
Introduces experimental login-activity tracking for #52319, allowing administrators to retrieve and filter users by their last successful authentication without querying stored login events.
Changes:
Adds a persistent, cached authentication timestamp to user models and API representations.
Records browser-login and client-credentials activity using plugin-compatible audit attributes.
Adds timestamp filters for user searches and counts, plus a legacy-attribute migration endpoint.
Only the JPA adapter implements persistence for this setter; AbstractUserAdapterFederatedStorage and LDAP's non-imported InMemoryUserAdapter inherit this no-op, so their successful logins permanently leave the new field null. Add a durable federated-storage implementation rather than assuming every authenticated user has a USER_ENTITY row.
Record last login after successful CIBA authentication
The new hook covers password grants, but CibaGrantType creates a user session and returns tokens through createTokenResponse without invoking either this hook or redirectAfterSuccessfulFlow. Successful CIBA authentications therefore never update the timestamp; add recording at that flow's successful completion as well.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Admin searches can return LDAP users that violate authentication-time filters, while timestamps remain vulnerable to edits or loss and concurrent client registrations can overwrite one another.
These filters are implemented only by JPA, but this search also queries external providers. LDAPStorageProvider.searchForUserStream() uses its free-text search branch when SEARCH is present and ignores the timestamp bounds, so this endpoint can return LDAP users with a null timestamp even when lastSuccessfulAuthenticationAfter is specified. Apply the bounds consistently across providers before pagination/counting, or explicitly exclude providers that cannot satisfy them.
Prevent concurrent client registrations from overwriting each other
The lock is released before the request transaction commits, and getConfiguration() still reads the request's cached realm snapshot. Two first logins for different clients on the same node can therefore both read the old configuration and overwrite each other's registrations despite this synchronized block. Serialize the complete transaction and reload fresh configuration inside it, or move registration to a transactionally coordinated path.
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
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.
Closes #52319
Primary an initial draft.
I left a comment in
UserAdapter.javaflagging that writing this field on every login triggers cluster-wide cache invalidation for that user's cache entry on every single login — there's no existing precedent in core for a per-login write at that volume, and it may need a write-through path that bypasses cache invalidation before this is stabilized.