Class UserMfaTempToken

  • All Implemented Interfaces:
    de.xima.cmn.dao.interfaces.IEntity<Long>, Serializable, Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>

    @Entity
    public class UserMfaTempToken
    extends Object
    implements de.xima.cmn.dao.interfaces.IEntity<Long>
    Entity representing the temporary token that is needed in conjunction with the two-factor authentication code when verifying a user via two-factor authentication.
    Since:
    8.4.0
    Author:
    Norman Lorenz
    See Also:
    Serialized Form
    • Constructor Detail

      • UserMfaTempToken

        public UserMfaTempToken()
    • Method Detail

      • compareTo

        public int compareTo​(de.xima.cmn.dao.interfaces.IEntity<Long> o)
        Specified by:
        compareTo in interface Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>
      • setUserDataJson

        public void setUserDataJson​(com.alibaba.fastjson.JSONObject userDataJson)
      • getUserDataJson

        public com.alibaba.fastjson.JSONObject getUserDataJson()
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • isPersisted

        public boolean isPersisted()
        Specified by:
        isPersisted in interface de.xima.cmn.dao.interfaces.IEntity<Long>
      • onCreate

        protected void onCreate()
        Pre persist hook to set the creation date.
      • getId

        public Long getId()
        Specified by:
        getId in interface de.xima.cmn.dao.interfaces.IEntity<Long>
      • getLockingVersion

        public int getLockingVersion()
      • getToken

        public String getToken()
        The token value used for two-factor authentication in conjunction with the two-factor authentication code. This token is generated as a UUID and stored as a string. It is unique and immutable once created.
      • getCreatedAt

        public Instant getCreatedAt()
        Instant when the token was created.
      • getExpiresAt

        public Instant getExpiresAt()
        Instant when the token was created.
      • getVerifyAttempts

        public int getVerifyAttempts()
        The number of attempts made to verify the user with this token.
      • getUniversalReferenceId

        public String getUniversalReferenceId()
      • getUserData

        public String getUserData()
      • getUserProfile

        public UserProfile getUserProfile()
        The user profile associated with this token.
      • getMfaType

        public EMultiFactorAuthenticationType getMfaType()
        The type of two-factor authentication that this token is associated with. This is used to determine how the user should authenticate (e.g., via email, TOTP, etc.).
      • getCode

        public String getCode()
        The two-factor authentication code that is associated with this token. This only has a value if the user uses two-factor authentication vis E-Mail. Is null if the user has set up two-factor authentication via an authenticator app TOTP or similar method that does not require a code.
      • setId

        public void setId​(Long id)
        Specified by:
        setId in interface de.xima.cmn.dao.interfaces.IEntity<Long>
      • setLockingVersion

        public void setLockingVersion​(int lockingVersion)
      • setToken

        public void setToken​(String token)
        The token value used for two-factor authentication in conjunction with the two-factor authentication code. This token is generated as a UUID and stored as a string. It is unique and immutable once created.
      • setCreatedAt

        public void setCreatedAt​(Instant createdAt)
        Instant when the token was created.
      • setExpiresAt

        public void setExpiresAt​(Instant expiresAt)
        Instant when the token was created.
      • setVerifyAttempts

        public void setVerifyAttempts​(int verifyAttempts)
        The number of attempts made to verify the user with this token.
      • setUniversalReferenceId

        public void setUniversalReferenceId​(String universalReferenceId)
      • setUserData

        public void setUserData​(String userData)
      • setUserProfile

        public void setUserProfile​(UserProfile userProfile)
        The user profile associated with this token.
      • setMfaType

        public void setMfaType​(EMultiFactorAuthenticationType mfaType)
        The type of two-factor authentication that this token is associated with. This is used to determine how the user should authenticate (e.g., via email, TOTP, etc.).
      • setCode

        public void setCode​(String code)
        The two-factor authentication code that is associated with this token. This only has a value if the user uses two-factor authentication vis E-Mail. Is null if the user has set up two-factor authentication via an authenticator app TOTP or similar method that does not require a code.