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 Details

    • CustomSessionRegistry

      public CustomSessionRegistry()
  • Method Details

    • getAllPrincipals

      public List<Object> getAllPrincipals()
      Specified by:
      getAllPrincipals in interface org.springframework.security.core.session.SessionRegistry
    • getAllSessions

      public List<org.springframework.security.core.session.SessionInformation> getAllSessions(Object principal, boolean includeExpiredSessions)
      Specified by:
      getAllSessions in interface org.springframework.security.core.session.SessionRegistry
    • getSessionInformation

      public org.springframework.security.core.session.SessionInformation getSessionInformation(String sessionId)
      Specified by:
      getSessionInformation in interface org.springframework.security.core.session.SessionRegistry
    • refreshLastRequest

      public void refreshLastRequest(String sessionId)
      Specified by:
      refreshLastRequest in interface org.springframework.security.core.session.SessionRegistry
    • registerNewSession

      public void registerNewSession(String sessionId, Object principal)
      Specified by:
      registerNewSession in interface org.springframework.security.core.session.SessionRegistry
    • removeSessionInformation

      public void removeSessionInformation(String sessionId)
      Specified by:
      removeSessionInformation in interface org.springframework.security.core.session.SessionRegistry
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.security.core.session.AbstractSessionEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.security.core.session.AbstractSessionEvent>