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 ReactiveSessionInformation and removes the related sessions
from the WebSessionStore. 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
ConstructorsConstructorDescriptionInvalidateLeastUsedServerMaximumSessionsExceededHandler(org.springframework.web.server.session.WebSessionStore webSessionStore) -
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(org.springframework.web.server.session.WebSessionStore webSessionStore)
-
-
Method Details
-
handle
Description copied from interface:ServerMaximumSessionsExceededHandlerHandles the scenario when the maximum number of sessions for a user has been reached.- Specified by:
handlein interfaceServerMaximumSessionsExceededHandler- Parameters:
context- the context with information about the sessions and the user- Returns:
- an empty
Monothat completes when the handling is done
-