Module com.erudika.para.server
Package com.erudika.para.server.security
Class AuthenticatedUserDetails
java.lang.Object
com.erudika.para.server.security.AuthenticatedUserDetails
- All Implemented Interfaces:
Serializable
,org.springframework.security.core.userdetails.UserDetails
public class AuthenticatedUserDetails
extends Object
implements org.springframework.security.core.userdetails.UserDetails
Stores information about authenticated users.
- Author:
- Alex Bogdanovski [[email protected]]
- See Also:
-
Constructor Summary
ConstructorDescriptionAuthenticatedUserDetails
(com.erudika.para.core.User user) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionCollection
<? extends org.springframework.security.core.GrantedAuthority> A list of roles for this user.Returns the main identifier for this user.The password.com.erudika.para.core.User
getUser()
Returns the underlying principal.The username.boolean
Same asUser.getActive()
.boolean
Same asUser.getActive()
.boolean
Same asUser.getActive()
.boolean
Same asUser.getActive()
.void
setUser
(com.erudika.para.core.User user) Sets the principal object.
-
Constructor Details
-
AuthenticatedUserDetails
public AuthenticatedUserDetails(com.erudika.para.core.User user) Default constructor.- Parameters:
user
- an authenticated user object (principal)
-
-
Method Details
-
getUser
public com.erudika.para.core.User getUser()Returns the underlying principal.- Returns:
- a
User
object
-
setUser
public void setUser(com.erudika.para.core.User user) Sets the principal object.- Parameters:
user
- a user
-
getAuthorities
A list of roles for this user.- Specified by:
getAuthorities
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- a list of roles
-
getUsername
The username. Same asUser.getIdentifier()
- Specified by:
getUsername
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
User.getIdentifier()
if user.appid == root appid, or "appid/user.identifier" if child app,- See Also:
-
isAccountNonExpired
public boolean isAccountNonExpired()Same asUser.getActive()
.- Specified by:
isAccountNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if active
- See Also:
-
isAccountNonLocked
public boolean isAccountNonLocked()Same asUser.getActive()
.- Specified by:
isAccountNonLocked
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if active
- See Also:
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()Same asUser.getActive()
.- Specified by:
isCredentialsNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if active
- See Also:
-
isEnabled
public boolean isEnabled()Same asUser.getActive()
.- Specified by:
isEnabled
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if active
- See Also:
-
getPassword
The password. A transient field used for validation.- Specified by:
getPassword
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- the password.
-
getIdentifier
Returns the main identifier for this user. An identifier is basically a unique username that identifies a user.- Returns:
- the main identifier
-