Class CustomUser
java.lang.Object
org.springframework.security.core.userdetails.User
org.craftercms.engine.util.spring.security.CustomUser
- All Implemented Interfaces:
Serializable
,org.springframework.security.core.CredentialsContainer
,org.springframework.security.core.userdetails.UserDetails
- Direct Known Subclasses:
ProfileUser
public class CustomUser
extends org.springframework.security.core.userdetails.User
Extension of
User
that includes custom attributes for site personalization
Note: This class should be used by all authentication providers to integrate with features like targeting
- Since:
- 3.1.5
- Author:
- joseross
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.security.core.userdetails.User
org.springframework.security.core.userdetails.User.UserBuilder
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCustomUser
(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) CustomUser
(String username, String password, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) -
Method Summary
Modifier and TypeMethodDescriptionboolean
<T> T
getAttribute
(String name) int
hashCode()
void
setAttribute
(String name, Object value) void
setAttributes
(Map<String, Object> attributes) toString()
Methods inherited from class org.springframework.security.core.userdetails.User
builder, eraseCredentials, getAuthorities, getPassword, getUsername, isAccountNonExpired, isAccountNonLocked, isCredentialsNonExpired, isEnabled, withDefaultPasswordEncoder, withUserDetails, withUsername
-
Field Details
-
attributes
-
-
Constructor Details
-
CustomUser
public CustomUser(String username, String password, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) -
CustomUser
public CustomUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
-
-
Method Details
-
getAttribute
-
setAttribute
-
getAttributes
-
setAttributes
-
equals
- Overrides:
equals
in classorg.springframework.security.core.userdetails.User
-
hashCode
public int hashCode()- Overrides:
hashCode
in classorg.springframework.security.core.userdetails.User
-
toString
- Overrides:
toString
in classorg.springframework.security.core.userdetails.User
-