Klasse LoginManager

java.lang.Object
de.dlr.proseo.ui.backend.LoginManager

@Component public class LoginManager extends Object
Management of user login and logout (thread safe)
Autor:
Dr. Thomas Bassler
  • Felddetails

  • Konstruktordetails

    • LoginManager

      public LoginManager()
  • Methodendetails

    • doLogin

      public boolean doLogin(String username, String password, String mission, boolean showLoginMessage)
      Log in to prosEO
      Parameter:
      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
      Gibt zurück:
      true, if the login was successful, false otherwise
    • doLogout

      public void doLogout()
      Log the logged in user out from prosEO
    • getUser

      public String getUser()
      Gets the name of the logged in user for service authentication (including mission prefix)
      Gibt zurück:
      the user name or null, if no user is logged in
    • getPassword

      public String getPassword()
      Gets the password of the logged in user
      Gibt zurück:
      the password or null, if no user is logged in
    • getMission

      public String getMission()
      Gets the code of the mission the current user is logged in to
      Gibt zurück:
      the mission code or null, if no user is logged in
    • getMissionPrefix

      public String getMissionPrefix()
      Gets the mission prefix consisting of the code of the mission the current user is logged in to appended with "-"
      Gibt zurück:
      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

      public List<String> getAuthorities()
      Gets the authorities granted to the user after login
      Gibt zurück:
      the granted authorities
    • hasRole

      public boolean hasRole(UserRole role)
      Checks whether the logged in user has the given role
      Parameter:
      role - the role to check
      Gibt zurück:
      true, if the respective authority was granted, false otherwise
    • getRoles

      public List<String> getRoles()
      Get user roles
      Gibt zurück:
      string list with user roles
    • isPasswordStrengthOk

      public boolean isPasswordStrengthOk(String password)
      Test the given password against the configured password strength parameters (length, element groups used)
      Parameter:
      password - the password to test
      Gibt zurück:
      true, if the password conforms to the password rules, false otherwise