Class CronappUserDetails
- java.lang.Object
-
- cronapp.framework.authentication.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 ThenormalizedUserNameandnormalizedEmailare 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCronappUserDetails.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protectedCronappUserDetails()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAccessFailedCount()Collection<? extends org.springframework.security.core.GrantedAuthority>getAuthorities()StringgetEmail()OffsetDateTimegetLockoutEnd()StringgetName()StringgetNormalizedEmail()StringgetNormalizedUserName()StringgetPassword()Map<String,Object>getPayload()StringgetPhoneNumber()byte[]getPicture()StringgetSecurityStamp()StringgetUsername()StringgetUserName()booleanisAccountNonExpired()booleanisAccountNonLocked()booleanisCredentialsNonExpired()booleanisEmailConfirmed()booleanisEnabled()booleanisLockoutEnabled()booleanisPhoneNumberConfirmed()booleanisTwoFactorEnabled()static CronappUserDetails.BuildernewBuilder()
-
-
-
Method Detail
-
getName
public String getName()
- Returns:
- The user's name.
-
getUserName
public String getUserName()
- Returns:
- The user name for this user.
-
getNormalizedUserName
public String getNormalizedUserName()
- Returns:
- The normalized user name for this user.
-
getEmail
public String getEmail()
- Returns:
- The email address for this user.
-
getNormalizedEmail
public String 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
public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails
-
getPassword
public String getPassword()
- Specified by:
getPasswordin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- A salted and hashed representation of the password for this user.
-
getUsername
public String 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
public String getSecurityStamp()
- Returns:
- A random value that must change whenever a users credentials change (password changed, login removed)
-
getPhoneNumber
public String 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
public OffsetDateTime 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()
-
getPayload
public Map<String,Object> getPayload()
- Returns:
- The payload received from the external authenticator
-
newBuilder
public static CronappUserDetails.Builder newBuilder()
-
-