Interface RefreshingUserProvider<U extends User>
- Type Parameters:
U- the concrete user type managed by this provider
- All Superinterfaces:
UserProvider
- All Known Implementing Classes:
DelegatingUserProvider
Optional extension for refreshing an already resolved
User.
This hook is useful for contexts that keep using a previously established user identity, but still need a fresh view of its roles, claims, or active/disabled status before authorization. For example, a websocket session can pin the user that was accepted when the session opened, then ask this provider to refresh that user for later socket messages without re-authenticating every frame from request headers or payload data.
Implementations should treat the supplied user as the trusted identity and return the current authoritative
representation of that same identity. Returning null is interpreted as no authenticated user.
-
Field Summary
Fields inherited from interface UserProvider
defaultUserProvider -
Method Summary
Modifier and TypeMethodDescriptionrefreshUser(U user, HasMessage message) Refreshes an already resolved user for the current message context.Methods inherited from interface UserProvider
addToMetadata, addToMetadata, andThen, containsUser, fromMessage, getActiveUser, getSystemUser, getUserById, removeFromMetadata
-
Method Details
-
refreshUser
Refreshes an already resolved user for the current message context.- Parameters:
user- the previously resolved user identitymessage- the message being authorized or handled- Returns:
- the refreshed user, or
nullif the user is no longer available
-