Class AdminAuthAPIImpl

  • All Implemented Interfaces:
    net.anotheria.anoplass.api.API, AdminAuthAPI

    public class AdminAuthAPIImpl
    extends net.anotheria.anoplass.api.AbstractAPIImpl
    implements AdminAuthAPI
    • Field Summary

      • Fields inherited from class net.anotheria.anoplass.api.AbstractAPIImpl

        DAY, HOUR, log, MINUTE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String authenticateByToken​(java.lang.String authToken)
      Authenticates user by token.
      void init()  
      java.lang.String login​(java.lang.String login, java.lang.String password)
      Used to initially log in user in admin-API.
      void logout()
      Logouts user from admin-API.
      protected void setTokens​(java.util.List<AuthTokenAO> tokens)  
      • Methods inherited from class net.anotheria.anoplass.api.AbstractAPIImpl

        addValidationError, addValidationError, checkValidationAndThrowException, deInit, getApiConfig, getAttributeFromSession, getCallContext, getCurrentLocale, getCurrentUserId, getDefaultExpirePeriodForAttribute, getExpirePeriodForAttribute, getLoggedInUserId, getPrivateAttributeName, getSession, removeAttributeFromSession, setAttributeInSession, setAttributeInSession, setAttributeInSession, setAttributeInSession
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface net.anotheria.anoplass.api.API

        deInit
    • Constructor Detail

      • AdminAuthAPIImpl

        public AdminAuthAPIImpl()
    • Method Detail

      • init

        public void init()
                  throws net.anotheria.anoplass.api.APIInitException
        Specified by:
        init in interface net.anotheria.anoplass.api.API
        Overrides:
        init in class net.anotheria.anoplass.api.AbstractAPIImpl
        Throws:
        net.anotheria.anoplass.api.APIInitException
      • login

        public java.lang.String login​(java.lang.String login,
                                      java.lang.String password)
                               throws AdminAPIAuthenticationException
        Description copied from interface: AdminAuthAPI
        Used to initially log in user in admin-API. Verifies credentials and if there are valid, returns a new created authToken. If not - exception. AuthToken then is used to call secured endpoints.
        Specified by:
        login in interface AdminAuthAPI
        Parameters:
        login - login
        password - password
        Returns:
        token in case of valid credentials
        Throws:
        AdminAPIAuthenticationException - in case of invalid credentials
      • logout

        public void logout()
        Description copied from interface: AdminAuthAPI
        Logouts user from admin-API. Deletes current authToken.
        Specified by:
        logout in interface AdminAuthAPI
      • setTokens

        protected void setTokens​(java.util.List<AuthTokenAO> tokens)