Package de.dlr.proseo.ui.gui
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends org.springframework.security.core.GrantedAuthority> Returns the granted authorities, which are roles or permissions for the user.Returns the credentials, usually the password.Returns the data cache.Returns additional details, in this case, the mission.Return the mission of the usergetName()Returns the username of the principal.Return the password of the principalReturns the principal, which represents the user's details.Returns the combined prosEO user name, which is a concatenation of mission name and username.Returns the list of user roles.booleanReturns whether the user is authenticated.booleanReturns whether it's a new login or not.voidsetAuthenticated(boolean isAuthenticated) Sets the authenticated flag.voidsetCredentials(Object credentials) Sets the credentials.voidsetDataCache(DataCache dataCache) Sets the data cache.voidsetDetails(String mission) Sets the mission details.voidsetNewLogin(boolean isNewLogin) Sets the new login flag.voidsetPrincipal(org.springframework.security.core.userdetails.UserDetails principal) Sets the principal, which represents the user's details.voidsetUserRoles(List<String> userRoles) Sets the list of user roles.
-
Constructor Details
-
GUIAuthenticationToken
public GUIAuthenticationToken()
-
-
Method Details
-
getDataCache
Returns the data cache.- Returns:
- the dataCache
-
setDataCache
Sets the data cache.- Parameters:
dataCache- the dataCache to set
-
getUserRoles
Returns the list of user roles.- Returns:
- the userRoles
-
setUserRoles
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
Returns the username of the principal. -
getPassword
Return the password of the principal- Returns:
- The password of the principal
-
getProseoName
Returns the combined prosEO user name, which is a concatenation of mission name and username.- Returns:
- The prosEO user name
-
getAuthorities
Returns the granted authorities, which are roles or permissions for the user.- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.Authentication
-
getCredentials
Returns the credentials, usually the password.- Specified by:
getCredentialsin interfaceorg.springframework.security.core.Authentication
-
setCredentials
Sets the credentials.- Parameters:
credentials- the user credentials
-
getDetails
Returns additional details, in this case, the mission.- Specified by:
getDetailsin interfaceorg.springframework.security.core.Authentication
-
setDetails
Sets the mission details.- Parameters:
mission- the mission to which the user is logged in
-
getMission
Return the mission of the user- Returns:
- The mission to which the user is logged in
-
getPrincipal
Returns the principal, which represents the user's details.- Specified by:
getPrincipalin interfaceorg.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:
isAuthenticatedin interfaceorg.springframework.security.core.Authentication
-
setAuthenticated
Sets the authenticated flag.- Specified by:
setAuthenticatedin interfaceorg.springframework.security.core.Authentication- Parameters:
isAuthenticated- true if the user is authenticated- Throws:
IllegalArgumentException
-