Class CustomerUserDetails

java.lang.Object
org.springframework.security.core.userdetails.User
org.broadleafcommerce.profile.core.service.CustomerUserDetails
All Implemented Interfaces:
Serializable, org.springframework.security.core.CredentialsContainer, org.springframework.security.core.userdetails.UserDetails

public class CustomerUserDetails extends org.springframework.security.core.userdetails.User
Created in order to utilize the Customer's primary key to salt passwords with. This allows username changes without requiring a password reset since the primary key should never change.
Author:
Phillip Verheyden (phillipuniverse)
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

    Fields
    Modifier and Type
    Field
    Description
    protected Long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomerUserDetails(Long id, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
     
    CustomerUserDetails(Long id, String username, String password, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    setId(Long id)
     
     

    Methods inherited from class org.springframework.security.core.userdetails.User

    builder, equals, eraseCredentials, getAuthorities, getPassword, getUsername, hashCode, isAccountNonExpired, isAccountNonLocked, isCredentialsNonExpired, isEnabled, toString, withDefaultPasswordEncoder, withUserDetails, withUsername

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • id

      protected Long id
  • Constructor Details

    • CustomerUserDetails

      public CustomerUserDetails(Long id, String username, String password, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
    • CustomerUserDetails

      public CustomerUserDetails(Long id, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
  • Method Details

    • withId

      public CustomerUserDetails withId(Long id)
    • getId

      public Long getId()
      Returns:
      the primary key of the Customer
    • setId

      public void setId(Long id)
      Parameters:
      id - the primary key of the Customer