Class UserAttributesRequest

java.lang.Object
com.broadleafcommerce.auth.resource.domain.UserAttributesRequest

public class UserAttributesRequest extends Object
A request DTO to adjust the attributes on a particular User.

By itself, this request has no affect on a user. It simply persists the user attributes to the database. At that point, it is up to the implementer to handle those attributes.

A common use-case is adding additional claims to a token. To do this, it is required to implement a custom JwtAccessTokenEnhancer and manually add any claims.

  • Constructor Details

    • UserAttributesRequest

      public UserAttributesRequest()
    • UserAttributesRequest

      public UserAttributesRequest(String userId, Map<String,Object> payload)
  • Method Details

    • getUserId

      public String getUserId()
      The id of the user to add additional attributes.
      See Also:
    • getPayload

      public Map<String,Object> getPayload()
      The values to add to the User's attributes.

      This is a key/value pair, and the key(s) should be a unique value. If these attributes are intended to be used as additional claims, a custom JwtAccessTokenEnhancer must be implemented.

      Returns:
      the values to add into the User's attributes
      See Also:
    • setUserId

      public void setUserId(String userId)
      The id of the user to add additional attributes.
      See Also:
    • setPayload

      public void setPayload(Map<String,Object> payload)
      The values to add to the User's attributes.

      This is a key/value pair, and the key(s) should be a unique value. If these attributes are intended to be used as additional claims, a custom JwtAccessTokenEnhancer must be implemented.

      Parameters:
      payload - the values to add to the User's attributes
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object