Class InvalidateLeastUsedServerMaximumSessionsExceededHandler
java.lang.Object
org.springframework.security.web.server.authentication.InvalidateLeastUsedServerMaximumSessionsExceededHandler
- All Implemented Interfaces:
ServerMaximumSessionsExceededHandler
public final class InvalidateLeastUsedServerMaximumSessionsExceededHandler
extends Object
implements ServerMaximumSessionsExceededHandler
Implementation of
ServerMaximumSessionsExceededHandler
that invalidates the
least recently used session(s). It only invalidates the amount of sessions that exceed
the maximum allowed. For example, if the maximum was exceeded by 1, only the least
recently used session will be invalidated.- Since:
- 6.3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>
handle
(MaximumSessionsContext context) Handles the scenario when the maximum number of sessions for a user has been reached.
-
Constructor Details
-
InvalidateLeastUsedServerMaximumSessionsExceededHandler
public InvalidateLeastUsedServerMaximumSessionsExceededHandler()
-
-
Method Details
-
handle
Description copied from interface:ServerMaximumSessionsExceededHandler
Handles the scenario when the maximum number of sessions for a user has been reached.- Specified by:
handle
in interfaceServerMaximumSessionsExceededHandler
- Parameters:
context
- the context with information about the sessions and the user- Returns:
- an empty
Mono
that completes when the handling is done
-