Interface AuthenticationMechanismHandler


  • public interface AuthenticationMechanismHandler
    This is a helper interface for authentication methods that needs certain support, such as for instance retrieving a CoreLogger object for logging or various possibilities to store and retrieve data on a session.
    • Method Detail

      • getNewSessionId

        java.lang.String getNewSessionId()
        Returns a new session identifier from the Policy Service session component. This is needed to be done if the user lacks a session and the authentication method needs to store certain data for the user during a "Challenge" return.
        Returns:
        The session ID, may be null when the maximum concurrent session limit is reached.
      • storeSessionData

        void storeSessionData​(OneValueAttributeList data,
                              java.lang.String sessionId)
        Stores data for this authentication method on the session.
        Parameters:
        data - A list of key-value pairs.
        sessionId - The session id.
      • removeSessionData

        void removeSessionData​(java.lang.String sessionId)
        Removes any stored data for this authentication method on the session.
        Parameters:
        sessionId - The session ID.
      • getSessionData

        OneValueAttributeList getSessionData​(java.lang.String sessionId)
        Retrieves any data for this authentication method stored on the session.
        Parameters:
        sessionId - The session ID.
        Returns:
        data A list of key-value pairs. May be null when no data is stored.
      • getLogger

        CoreLogger getLogger​(java.lang.Class clazz)
        Retrieves a CoreLogger object for logging purposes. This enables a authentication method to use Policy Service's logging settings and so on.
        Parameters:
        clazz - The class wishing to make logging output. This may enable (if configured) class name logging.
        Returns:
        A CoreLogger object.
      • getSessionsBasedOnUserName

        java.util.List<com.portwise.core.session.Session> getSessionsBasedOnUserName​(java.lang.String userId)
        Retrieves all sessions given a userId.
        Returns:
        A list of session or an empty list. Never null.