Class AuthenticationTools


  • public class AuthenticationTools
    extends Object
    Author:
    Ulrich
    • Constructor Detail

      • AuthenticationTools

        public AuthenticationTools()
    • Method Detail

      • createSession

        public static String createSession​(String userName,
                                           String userPass)
                                    throws Exception
        Authenticates a user and returns the created sessionId.
        Parameters:
        userName -
        userPass -
        Returns:
        Throws:
        Exception
      • destroySession

        public static boolean destroySession​(String sessionId,
                                             boolean remove)
                                      throws Exception
        Logs out a user from the current session. This will either update the expires timestamp from table session_store or remove it completely.
        Parameters:
        sessionId -
        remove -
        Returns:
        Throws:
        Exception
      • getAndRenewLoggedInUser

        public static de.narimo.commons.UserCredentials getAndRenewLoggedInUser​(String sessionid)
                                                                         throws Exception
        Looks up a session id in the session store and updates the session expires timestamp.
        Parameters:
        sessionid -
        Returns:
        Throws:
        Exception