Package cronapp.framework.security
Class CronappUserDetails
java.lang.Object
cronapp.framework.security.CronappUserDetails
- All Implemented Interfaces:
Serializable,org.springframework.security.core.userdetails.UserDetails
public class CronappUserDetails
extends Object
implements org.springframework.security.core.userdetails.UserDetails
Represents a user in the system
The
normalizedUserName and normalizedEmail are there for performance reasons and are used to validate
the case insensitive uniqueness of the userName and email fields. They are persisted in the database in order be able
to create index on them, thus making the lookups by the normalized user name and email sargable.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCollection<? extends org.springframework.security.core.GrantedAuthority> getEmail()getName()byte[]booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanstatic CronappUserDetails.Builder
-
Constructor Details
-
CronappUserDetails
protected CronappUserDetails()
-
-
Method Details
-
getName
- Returns:
- The user's name.
-
getUserName
- Returns:
- The user name for this user.
-
getNormalizedUserName
- Returns:
- The normalized user name for this user.
-
getEmail
- Returns:
- The email address for this user.
-
getNormalizedEmail
- Returns:
- The normalized email address for this user.
-
isEmailConfirmed
public boolean isEmailConfirmed()- Returns:
- A flag indicating if a user has confirmed their email address.
-
getAuthorities
- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails
-
getPassword
- Specified by:
getPasswordin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- A salted and hashed representation of the password for this user.
-
getUsername
- Specified by:
getUsernamein interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonExpired
public boolean isAccountNonExpired()- Specified by:
isAccountNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonLocked
public boolean isAccountNonLocked()- Specified by:
isAccountNonLockedin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()- Specified by:
isCredentialsNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceorg.springframework.security.core.userdetails.UserDetails
-
getSecurityStamp
- Returns:
- A random value that must change whenever a users credentials change (password changed, login removed)
-
getPhoneNumber
- Returns:
- A telephone number for the user.
-
isPhoneNumberConfirmed
public boolean isPhoneNumberConfirmed()- Returns:
- A flag indicating if a user has confirmed their telephone address.
-
isTwoFactorEnabled
public boolean isTwoFactorEnabled()- Returns:
- A flag indicating if two factor authentication is enabled for this user.
-
getLockoutEnd
- Returns:
- The date and time when any user lockout ends.
-
isLockoutEnabled
public boolean isLockoutEnabled()- Returns:
- A flag indicating if the user could be locked out.
-
getAccessFailedCount
public int getAccessFailedCount()- Returns:
- The number of failed login attempts for the current user.
-
getPicture
public byte[] getPicture() -
getProvider
-
getPayload
- Returns:
- The payload received from the external authenticator
-
newBuilder
-