public class AuthService extends Object
Modifier and Type | Field and Description |
---|---|
static HashMap<String,String> |
USER_PASSWORD
Username-password storing map, loaded at the bootstrap
|
static HashMap<String,ArrayList<String>> |
USER_PERMISSIONS
Username-permission storing map, loaded at the bootstrap
|
static HashMap<String,String> |
USER_TOKEN
Map that save the tokens issued to the authenticated users
|
Constructor and Description |
---|
AuthService() |
Modifier and Type | Method and Description |
---|---|
String |
getPasswordFile() |
String |
getPermissionFile() |
void |
init()
Reads the permission configuration file and user-password file and load to the system
|
String |
login(JsonUsernamePasswordObject authJsonToken)
Invoke shiro user authentication and that will direct to the Authorization Realm.
|
void |
setPasswordFile(String passwordFile) |
void |
setPermissionFile(String permissionFile) |
public static HashMap<String,String> USER_TOKEN
public static HashMap<String,String> USER_PASSWORD
public String login(JsonUsernamePasswordObject authJsonToken) throws ManagementServiceException
authJsonToken
- Object that wraps the username and password provided by the userManagementServiceException
- if fails to authenticate the userpublic void init() throws IOException
IOException
- if reading the permissions file or username-password file failspublic String getPermissionFile()
public void setPermissionFile(String permissionFile)
public String getPasswordFile()
public void setPasswordFile(String passwordFile)
Copyright © 2016–2019 AdroitLogic. All rights reserved.