Package de.dlr.proseo.ui.backend
Class LoginManager
java.lang.Object
de.dlr.proseo.ui.backend.LoginManager
Management of user login and logout (thread safe)
- Author:
- Dr. Thomas Bassler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanLog in to prosEOvoiddoLogout()Log the logged in user out from prosEOGets the authorities granted to the user after loginGets the code of the mission the current user is logged in toGets the mission prefix consisting of the code of the mission the current user is logged in to appended with "-"Gets the password of the logged in usergetRoles()Get user rolesgetUser()Gets the name of the logged in user for service authentication (including mission prefix)booleanChecks whether the logged in user has the given rolebooleanisPasswordStrengthOk(String password) Test the given password against the configured password strength parameters (length, element groups used)
-
Field Details
-
MISSION_PREFIX_CHAR
- See Also:
-
-
Constructor Details
-
LoginManager
public LoginManager()
-
-
Method Details
-
doLogin
Log in to prosEO- Parameters:
username- the user name for login (without mission prefix; optional, will be requested from standard input, if not set)password- the password for login (optional, will be requested from standard input, if not set)mission- the mission to log in to (may be null for user with prosEO Administrator privileges)showLoginMessage- if true, show a message upon successful login- Returns:
- true, if the login was successful, false otherwise
-
doLogout
public void doLogout()Log the logged in user out from prosEO -
getUser
Gets the name of the logged in user for service authentication (including mission prefix)- Returns:
- the user name or null, if no user is logged in
-
getPassword
Gets the password of the logged in user- Returns:
- the password or null, if no user is logged in
-
getMission
Gets the code of the mission the current user is logged in to- Returns:
- the mission code or null, if no user is logged in
-
getMissionPrefix
Gets the mission prefix consisting of the code of the mission the current user is logged in to appended with "-"- Returns:
- the mission prefix or an empty string, if no user is logged in, or if the current user is not logged in to any mission
-
getAuthorities
Gets the authorities granted to the user after login- Returns:
- the granted authorities
-
hasRole
Checks whether the logged in user has the given role- Parameters:
role- the role to check- Returns:
- true, if the respective authority was granted, false otherwise
-
getRoles
Get user roles- Returns:
- string list with user roles
-
isPasswordStrengthOk
Test the given password against the configured password strength parameters (length, element groups used)- Parameters:
password- the password to test- Returns:
- true, if the password conforms to the password rules, false otherwise
-