Class AdminAuthAPIImpl

java.lang.Object
net.anotheria.anoplass.api.AbstractAPIImpl
net.anotheria.portalkit.adminapi.api.auth.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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Authenticates user by token.
    void
     
    login(String login, String password)
    Used to initially log in user in admin-API.
    void
    Logouts user from admin-API.
    protected void
     

    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 Details

    • AdminAuthAPIImpl

      public AdminAuthAPIImpl()
  • Method Details

    • 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
    • authenticateByToken

      public String authenticateByToken(String authToken) throws AdminAPIAuthenticationException
      Description copied from interface: AdminAuthAPI
      Authenticates user by token. If token is valid, returns login and allows the further processing, otherwise throws an exception.
      Specified by:
      authenticateByToken in interface AdminAuthAPI
      Parameters:
      authToken - token to verify
      Returns:
      login in case of valid token
      Throws:
      AdminAPIAuthenticationException - in case of invalid token
    • login

      public String login(String login, 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(List<AuthTokenAO> tokens)