Class 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:
    Serialized Form
    • Constructor Detail

      • 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 Detail

      • getAttribute

        public <T> T getAttribute​(String name)
      • setAttribute

        public void setAttribute​(String name,
                                 Object value)
      • setAttributes

        public void setAttributes​(Map<String,​Object> attributes)
      • equals

        public boolean equals​(Object o)
        Overrides:
        equals in class org.springframework.security.core.userdetails.User
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class org.springframework.security.core.userdetails.User
      • toString

        public String toString()
        Overrides:
        toString in class org.springframework.security.core.userdetails.User