Class AuthInfo


public class AuthInfo
extends java.lang.Object
A default JPA implementation for authentication data This class implements the requirements for use as a data type in UserDatabase. To use these classes, you need to map them to a database using JPA.

The auth1 feature example contains an example mapping file (examples/feature/auth1/src/META-INF/orm.xml), and a Postgres schema file (examples/feature/auth1/src/META-INF/schema.postgres.sql).

To add extra fields to a user's profile you need to extend AbstractUser.
See Also:
  • Constructor Details

    • AuthInfo

      public AuthInfo()
  • Method Details

    • setUser

      public void setUser​(AbstractUser user)
      Sets the user. This sets the user that owns this authentication information. AbstractUser is an empty class by default, you can extend it to add extra field (e.g.: First name, Last name, ...).
    • getUser

      public AbstractUser getUser()
      Returns a reference to the user.
      See Also:
      setUser(AbstractUser user)
    • setPassword

      public void setPassword​(java.lang.String hash, java.lang.String hashFunction, java.lang.String hashSalt)
      Sets a password.
    • getPasswordHash

      public java.lang.String getPasswordHash()
      Returns the password hash.
      See Also:
      setPassword(String hash, String hashFunction, String hashSalt)
    • setPasswordHash

      public void setPasswordHash​(java.lang.String passwordHash)
    • getPasswordMethod

      public java.lang.String getPasswordMethod()
      Returns the password method.
      See Also:
      setPassword(String hash, String hashFunction, String hashSalt)
    • setPasswordMethod

      public void setPasswordMethod​(java.lang.String passwordMethod)
    • getPasswordSalt

      public java.lang.String getPasswordSalt()
      Returns the password salt.
      See Also:
      setPassword(String hash, String hashFunction, String hashSalt)
    • setPasswordSalt

      public void setPasswordSalt​(java.lang.String passwordSalt)
    • setEmail

      public void setEmail​(java.lang.String email)
      Sets the email address.
    • getEmail

      public java.lang.String getEmail()
      Returns the email address.
      See Also:
      setEmail(String email)
    • setUnverifiedEmail

      public void setUnverifiedEmail​(java.lang.String email)
      Sets the unverified email address.
    • getUnverifiedEmail

      public java.lang.String getUnverifiedEmail()
      Returns the unverified email address.
      See Also:
      setUnverifiedEmail(String email)
    • setEmailToken

      public void setEmailToken​(java.lang.String hash, java.util.Date expires, User.EmailTokenRole role)
      Sets the email token.
    • getEmailToken

      public java.lang.String getEmailToken()
      Returns the email token.
      See Also:
      setEmailToken(String hash, Date expires, User.EmailTokenRole role)
    • setEmailToken

      public void setEmailToken​(java.lang.String emailToken)
    • getEmailTokenExpires

      public java.util.Date getEmailTokenExpires()
      Returns the email token expiration date.
      See Also:
      setEmailToken(String hash, Date expires, User.EmailTokenRole role)
    • setEmailTokenExpires

      public void setEmailTokenExpires​(java.util.Date emailTokenExpires)
    • getEmailTokenRole

      public User.EmailTokenRole getEmailTokenRole()
      Returns the email token role.
      See Also:
      setEmailToken(String hash, Date expires, User.EmailTokenRole role)
    • setEmailTokenRole

      public void setEmailTokenRole​(User.EmailTokenRole emailTokenRole)
    • setStatus

      public void setStatus​(User.Status status)
      Sets the status.
    • getStatus

      public User.Status getStatus()
      Returns the status.
      See Also:
      setStatus(User.Status status)
    • setFailedLoginAttempts

      public void setFailedLoginAttempts​(int count)
      Sets the number of failed login attempts.
    • getFailedLoginAttempts

      public int getFailedLoginAttempts()
      Returns the number of failed login attempts.
      See Also:
      setFailedLoginAttempts(int count)
    • setLastLoginAttempt

      public void setLastLoginAttempt​(java.util.Date dt)
      Sets the time of the last login attempt.
    • getLastLoginAttempt

      public java.util.Date getLastLoginAttempt()
      Returns the time of the last login attempt.
      See Also:
      setLastLoginAttempt(Date dt)
    • getAuthTokens

      public java.util.List<AuthToken> getAuthTokens()
      Returns the authentication tokens.
    • setAuthTokens

      public void setAuthTokens​(java.util.List<AuthToken> authTokens)
    • getAuthIdentities

      public java.util.List<AuthIdentity> getAuthIdentities()
      Returns the authentication identities.
    • setAuthIdentities

      public void setAuthIdentities​(java.util.List<AuthIdentity> authIdentities)
    • getId

      public long getId()
    • setId

      public void setId​(long id)
    • getVersion

      public int getVersion()
    • setVersion

      public void setVersion​(int version)