Interface RefreshingUserProvider<U extends User>

Type Parameters:
U - the concrete user type managed by this provider
All Superinterfaces:
UserProvider
All Known Implementing Classes:
DelegatingUserProvider

public interface RefreshingUserProvider<U extends User> extends UserProvider
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.

  • Method Details

    • refreshUser

      U refreshUser(U user, HasMessage message)
      Refreshes an already resolved user for the current message context.
      Parameters:
      user - the previously resolved user identity
      message - the message being authorized or handled
      Returns:
      the refreshed user, or null if the user is no longer available