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
-
-
Constructor Summary
Constructors Constructor Description AdminAuthAPIImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringauthenticateByToken(java.lang.String authToken)Authenticates user by token.voidinit()java.lang.Stringlogin(java.lang.String login, java.lang.String password)Used to initially log in user in admin-API.voidlogout()Logouts user from admin-API.protected voidsetTokens(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
-
-
-
-
Method Detail
-
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
public java.lang.String authenticateByToken(java.lang.String authToken) throws AdminAPIAuthenticationExceptionDescription 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
public java.lang.String login(java.lang.String login, java.lang.String password) throws AdminAPIAuthenticationExceptionDescription 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
protected void setTokens(java.util.List<AuthTokenAO> tokens)
-
-