Package swiss.trustbroker.oidc
Class CustomSessionRegistry
java.lang.Object
swiss.trustbroker.oidc.CustomSessionRegistry
- All Implemented Interfaces:
EventListener,org.springframework.context.ApplicationListener<org.springframework.security.core.session.AbstractSessionEvent>,org.springframework.security.core.session.SessionRegistry
public class CustomSessionRegistry
extends Object
implements org.springframework.security.core.session.SessionRegistry, org.springframework.context.ApplicationListener<org.springframework.security.core.session.AbstractSessionEvent>
No-op SessionRegistry - sessions are handled in the DB.
The default implementation leads to leaks if the
SessionDestroyedEvent is not received
(e.g. multi-pod setup).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.springframework.security.core.session.SessionInformation> getAllSessions(Object principal, boolean includeExpiredSessions) org.springframework.security.core.session.SessionInformationgetSessionInformation(String sessionId) voidonApplicationEvent(org.springframework.security.core.session.AbstractSessionEvent event) voidrefreshLastRequest(String sessionId) voidregisterNewSession(String sessionId, Object principal) voidremoveSessionInformation(String sessionId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
CustomSessionRegistry
public CustomSessionRegistry()
-
-
Method Details
-
getAllPrincipals
- Specified by:
getAllPrincipalsin interfaceorg.springframework.security.core.session.SessionRegistry
-
getAllSessions
public List<org.springframework.security.core.session.SessionInformation> getAllSessions(Object principal, boolean includeExpiredSessions) - Specified by:
getAllSessionsin interfaceorg.springframework.security.core.session.SessionRegistry
-
getSessionInformation
public org.springframework.security.core.session.SessionInformation getSessionInformation(String sessionId) - Specified by:
getSessionInformationin interfaceorg.springframework.security.core.session.SessionRegistry
-
refreshLastRequest
- Specified by:
refreshLastRequestin interfaceorg.springframework.security.core.session.SessionRegistry
-
registerNewSession
- Specified by:
registerNewSessionin interfaceorg.springframework.security.core.session.SessionRegistry
-
removeSessionInformation
- Specified by:
removeSessionInformationin interfaceorg.springframework.security.core.session.SessionRegistry
-
onApplicationEvent
public void onApplicationEvent(org.springframework.security.core.session.AbstractSessionEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.security.core.session.AbstractSessionEvent>
-