Class InMemorySessionIdMapper

java.lang.Object
org.keycloak.adapters.spi.InMemorySessionIdMapper
All Implemented Interfaces:
SessionIdMapper

public class InMemorySessionIdMapper extends Object implements SessionIdMapper
Maps external principal and SSO id to internal local http session id
Version:
$Revision: 1 $
Author:
Bill Burke
  • Constructor Details

    • InMemorySessionIdMapper

      public InMemorySessionIdMapper()
  • Method Details

    • hasSession

      public boolean hasSession(String id)
      Description copied from interface: SessionIdMapper
      Returns true if the mapper contains mapping for the given HTTP session ID.
      Specified by:
      hasSession in interface SessionIdMapper
      Returns:
    • clear

      public void clear()
      Description copied from interface: SessionIdMapper
      Clears all mappings from this mapper.
      Specified by:
      clear in interface SessionIdMapper
    • getUserSessions

      public Set<String> getUserSessions(String principal)
      Description copied from interface: SessionIdMapper
      Returns set of HTTP session IDs for the given principal.
      Specified by:
      getUserSessions in interface SessionIdMapper
      Parameters:
      principal - Principal
      Returns:
    • getSessionFromSSO

      public String getSessionFromSSO(String sso)
      Description copied from interface: SessionIdMapper
      Returns HTTP session ID from the given user session ID.
      Specified by:
      getSessionFromSSO in interface SessionIdMapper
      Parameters:
      sso - User session ID
      Returns:
    • map

      public void map(String sso, String principal, String session)
      Description copied from interface: SessionIdMapper
      Establishes mapping between user session ID, principal and HTTP session ID.
      Specified by:
      map in interface SessionIdMapper
      Parameters:
      sso - User session ID
      principal - Principal
      session - HTTP session ID
    • removeSession

      public void removeSession(String session)
      Description copied from interface: SessionIdMapper
      Removes mappings for the given HTTP session ID.
      Specified by:
      removeSession in interface SessionIdMapper
      Parameters:
      session - HTTP session ID.