Class User

java.lang.Object
com.auth0.json.mgmt.users.User
All Implemented Interfaces:
Serializable

public class User extends Object implements Serializable
Class that represents an Auth0 User object. Related to the UsersEntity entity.
See Also:
  • Constructor Details

    • User

      public User()
    • User

      public User(String connection)
  • Method Details

    • setConnection

      public void setConnection(String connection)
      Setter for the connection this user will be created into.
      Parameters:
      connection - the connection to set.
    • setPassword

      @Deprecated public void setPassword(String password)
      Deprecated.
      Use setPassword(char[]) instead.
      Setter for the password this user will have once created.
      Parameters:
      password - the password to set.
    • setPassword

      public void setPassword(char[] password)
      Setter for the password this user will have once created.
      Parameters:
      password - the password to set.
    • getUsername

      public String getUsername()
      Getter for the user's username.
      Returns:
      the username.
    • setUsername

      public void setUsername(String username)
      Setter for the user's username.
      Parameters:
      username - the username
    • getEmail

      public String getEmail()
      Getter for the user's email.
      Returns:
      the email.
    • setEmail

      public void setEmail(String email)
      Setter for the user's email.
      Parameters:
      email - the email to set.
    • isEmailVerified

      public Boolean isEmailVerified()
      Whether the email was verified or not.
      Returns:
      true if the email was verified, false otherwise.
    • setEmailVerified

      public void setEmailVerified(Boolean emailVerified)
      Sets if the email was verified or not.
      Parameters:
      emailVerified - whether the email was verified or not.
    • getPhoneNumber

      public String getPhoneNumber()
      Getter for the user's phone number (following the E.164 recommendation), only valid for users from SMS connections.
      Returns:
      the user's phone number.
    • setPhoneNumber

      public void setPhoneNumber(String phoneNumber)
      Setter for the user's phone number (following the E.164 recommendation), only valid when creating a user on SMS connections.
      Parameters:
      phoneNumber - the phone number to set.
    • isPhoneVerified

      public Boolean isPhoneVerified()
      Whether the phone number was verified or not.
      Returns:
      true if the phone number was verified, false otherwise.
    • setPhoneVerified

      public void setPhoneVerified(Boolean phoneVerified)
      Sets if the phone number was verified or not.
      Parameters:
      phoneVerified - whether the phone number was verified or not.
    • getId

      public String getId()
      Getter for the user's unique identifier.
      Returns:
      the user id.
    • setId

      public void setId(String userId)
      Setter for the user's unique identifier. This is only valid when creating a new user, as the property can't change once set. The server will prepend the connection name and a pipe character before the given id value. i.e. For "auth0" connection with user id "123456789" the final user id would be "auth0|123456789".
      Parameters:
      userId - the id of the user
    • getPicture

      public String getPicture()
      Getter for the user's picture url.
      Returns:
      the picture url.
    • setPicture

      public void setPicture(String picture)
      Setter for the user's picture url.
      Parameters:
      picture - the picture url to set.
    • getName

      public String getName()
      Getter for the user's name.
      Returns:
      the name.
    • setName

      public void setName(String name)
      Setter for the user's name.
      Parameters:
      name - the name to set.
    • getNickname

      public String getNickname()
      Getter for the user's nickname.
      Returns:
      the nickname.
    • setNickname

      public void setNickname(String nickname)
      Setter for the user's nickname.
      Parameters:
      nickname - the nickname to set.
    • getGivenName

      public String getGivenName()
      Getter for the user's given name.
      Returns:
      the given name.
    • setGivenName

      public void setGivenName(String givenName)
      Setter for the user's given name.
      Parameters:
      givenName - the given name to set.
    • getFamilyName

      public String getFamilyName()
      Getter for the user's family name.
      Returns:
      the family name.
    • setFamilyName

      public void setFamilyName(String familyName)
      Setter for the user's family name.
      Parameters:
      familyName - the family name to set.
    • getCreatedAt

      public Date getCreatedAt()
      Getter for the date this user was created on.
      Returns:
      the created at.
    • getUpdatedAt

      public Date getUpdatedAt()
      Getter for the date this user was last updated on.
      Returns:
      the updated at.
    • getIdentities

      public List<Identity> getIdentities()
      Getter for the list of user's identities information. More than one will exists in case accounts are linked.
      Returns:
      the list of user's identities.
    • getAppMetadata

      public Map<String,Object> getAppMetadata()
      Getter for the metadata of the application.
      Returns:
      the application metadata.
    • setAppMetadata

      public void setAppMetadata(Map<String,Object> appMetadata)
      Setter for the metadata of the application.
      Parameters:
      appMetadata - the application metadata to set.
    • getUserMetadata

      public Map<String,Object> getUserMetadata()
      Getter for the metadata of the user.
      Returns:
      the user metadata.
    • setUserMetadata

      public void setUserMetadata(Map<String,Object> userMetadata)
      Setter for the metadata of the user.
      Parameters:
      userMetadata - the user metadata to set.
    • getMultifactor

      public List<String> getMultifactor()
      Getter for the list of multifactor providers that the user has enrolled to.
      Returns:
      the list of enrolled multifactor providers.
    • getLastIP

      public String getLastIP()
      Getter for the last login IP.
      Returns:
      the last IP.
    • getLastLogin

      public Date getLastLogin()
      Getter for the last login date.
      Returns:
      the last login.
    • getLastPasswordReset

      public Date getLastPasswordReset()
      Getter for the last password reset date. Only available for Database Connection users.
      Returns:
      the last password reset.
    • getLoginsCount

      public Integer getLoginsCount()
      Getter for the number of logins for this user.
      Returns:
      the logins count.
    • isBlocked

      public Boolean isBlocked()
      Whether the user is blocked or not.
      Returns:
      true if the user is blocked, false otherwise.
    • setBlocked

      public void setBlocked(Boolean blocked)
      Sets if the user is blocked or not.
      Parameters:
      blocked - whether the user is blocked or not.
    • setClientId

      public void setClientId(String clientId)
      Setter for the Auth0 Application's client ID. Only useful when updating the email.
      Parameters:
      clientId - the application's client ID to set.
    • setVerifyPassword

      public void setVerifyPassword(Boolean verifyPassword)
      Sets if a password change should be verified via email.
      Parameters:
      verifyPassword - true if a password change should be verified via email, false otherwise.
    • setVerifyEmail

      public void setVerifyEmail(Boolean verifyEmail)
      Sets if an email change should be verified.
      Parameters:
      verifyEmail - true if an email change should be verified, false otherwise.
    • setVerifyPhoneNumber

      public void setVerifyPhoneNumber(Boolean verifyPhoneNumber)
      Sets if a phone number change should be verified.
      Parameters:
      verifyPhoneNumber - true if a phone number change should be verified, false otherwise.
    • getValues

      public Map<String,Object> getValues()