Class GUIAuthenticationToken

java.lang.Object
de.dlr.proseo.ui.gui.GUIAuthenticationToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication

public class GUIAuthenticationToken extends Object implements org.springframework.security.core.Authentication
Represents a token for an authentication within a Graphical User Interface. It holds the credentials, principal details and other related data like roles, mission, etc. This class is used for authenticating a user within a GUI-based application.
Author:
David Mazo
See Also:
  • Constructor Details

    • GUIAuthenticationToken

      public GUIAuthenticationToken()
  • Method Details

    • getDataCache

      public DataCache getDataCache()
      Returns the data cache.
      Returns:
      the dataCache
    • setDataCache

      public void setDataCache(DataCache dataCache)
      Sets the data cache.
      Parameters:
      dataCache - the dataCache to set
    • getUserRoles

      public List<String> getUserRoles()
      Returns the list of user roles.
      Returns:
      the userRoles
    • setUserRoles

      public void setUserRoles(List<String> userRoles)
      Sets the list of user roles.
      Parameters:
      userRoles - the userRoles to set
    • isNewLogin

      public boolean isNewLogin()
      Returns whether it's a new login or not.
      Returns:
      the isNewLogin
    • setNewLogin

      public void setNewLogin(boolean isNewLogin)
      Sets the new login flag.
      Parameters:
      isNewLogin - true if the login is new
    • getName

      public String getName()
      Returns the username of the principal.
      Specified by:
      getName in interface Principal
    • getPassword

      public String getPassword()
      Return the password of the principal
      Returns:
      The password of the principal
    • getProseoName

      public String getProseoName()
      Returns the combined prosEO user name, which is a concatenation of mission name and username.
      Returns:
      The prosEO user name
    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Returns the granted authorities, which are roles or permissions for the user.
      Specified by:
      getAuthorities in interface org.springframework.security.core.Authentication
    • getCredentials

      public Object getCredentials()
      Returns the credentials, usually the password.
      Specified by:
      getCredentials in interface org.springframework.security.core.Authentication
    • setCredentials

      public void setCredentials(Object credentials)
      Sets the credentials.
      Parameters:
      credentials - the user credentials
    • getDetails

      public Object getDetails()
      Returns additional details, in this case, the mission.
      Specified by:
      getDetails in interface org.springframework.security.core.Authentication
    • setDetails

      public void setDetails(String mission)
      Sets the mission details.
      Parameters:
      mission - the mission to which the user is logged in
    • getMission

      public String getMission()
      Return the mission of the user
      Returns:
      The mission to which the user is logged in
    • getPrincipal

      public Object getPrincipal()
      Returns the principal, which represents the user's details.
      Specified by:
      getPrincipal in interface org.springframework.security.core.Authentication
    • setPrincipal

      public void setPrincipal(org.springframework.security.core.userdetails.UserDetails principal)
      Sets the principal, which represents the user's details.
      Parameters:
      principal - the user details
    • isAuthenticated

      public boolean isAuthenticated()
      Returns whether the user is authenticated.
      Specified by:
      isAuthenticated in interface org.springframework.security.core.Authentication
    • setAuthenticated

      public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException
      Sets the authenticated flag.
      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Parameters:
      isAuthenticated - true if the user is authenticated
      Throws:
      IllegalArgumentException