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 -
Method Summary
Modifier and TypeMethodDescriptionauthenticateByToken(String authToken) Authenticates user by token.voidinit()Used to initially log in user in admin-API.voidlogout()Logouts user from admin-API.protected voidsetTokens(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, setAttributeInSessionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
initin interfacenet.anotheria.anoplass.api.API- Overrides:
initin classnet.anotheria.anoplass.api.AbstractAPIImpl- Throws:
net.anotheria.anoplass.api.APIInitException
-
authenticateByToken
Description copied from interface:AdminAuthAPIAuthenticates user by token. If token is valid, returns login and allows the further processing, otherwise throws an exception.- Specified by:
authenticateByTokenin interfaceAdminAuthAPI- Parameters:
authToken- token to verify- Returns:
- login in case of valid token
- Throws:
AdminAPIAuthenticationException- in case of invalid token
-
login
Description copied from interface:AdminAuthAPIUsed 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:
loginin interfaceAdminAuthAPI- Parameters:
login- loginpassword- password- Returns:
- token in case of valid credentials
- Throws:
AdminAPIAuthenticationException- in case of invalid credentials
-
logout
public void logout()Description copied from interface:AdminAuthAPILogouts user from admin-API. Deletes current authToken.- Specified by:
logoutin interfaceAdminAuthAPI
-
setTokens
-