Class 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 TokenEnhancer and manually add any claims.

    • Constructor Detail

      • UserAttributesRequest

        public UserAttributesRequest()
    • Method Detail

      • getUserId

        public String getUserId()
        The id of the user to add additional attributes.
        See Also:
        User.getId()
      • 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 TokenEnhancer must be implemented.

        Returns:
        the values to add into the User's attributes
        See Also:
        User.getAttributes()
      • setUserId

        public void setUserId​(String userId)
        The id of the user to add additional attributes.
        See Also:
        User.getId()
      • 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 TokenEnhancer must be implemented.

        Parameters:
        payload - the values to add to the User's attributes
        See Also:
        User.getAttributes()
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object