Interface AdminAuthAPI
-
- All Superinterfaces:
net.anotheria.anoplass.api.API
- All Known Implementing Classes:
AdminAuthAPIImpl
public interface AdminAuthAPI extends net.anotheria.anoplass.api.APIAPI to perform authentication for admin-API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringauthenticateByToken(java.lang.String authToken)Authenticates user by token.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.
-
-
-
Method Detail
-
authenticateByToken
java.lang.String authenticateByToken(java.lang.String authToken) throws AdminAPIAuthenticationExceptionAuthenticates user by token. If token is valid, returns login and allows the further processing, otherwise throws an exception.- Parameters:
authToken- token to verify- Returns:
- login in case of valid token
- Throws:
AdminAPIAuthenticationException- in case of invalid token
-
login
java.lang.String login(java.lang.String login, java.lang.String password) throws AdminAPIAuthenticationExceptionUsed 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.- Parameters:
login- loginpassword- password- Returns:
- token in case of valid credentials
- Throws:
AdminAPIAuthenticationException- in case of invalid credentials
-
logout
void logout()
Logouts user from admin-API. Deletes current authToken.
-
-