Class MMFARegistration

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_MFA_Registration, I_Persistent, Evaluatee

public class MMFARegistration extends X_MFA_Registration
Multi-factor Authentication Registration
See Also:
  • Constructor Details

    • MMFARegistration

      public MMFARegistration(Properties ctx, String MFA_Registration_UU, String trxName)
      UUID based Constructor
      Parameters:
      ctx - Context
      MFA_Registration_UU - UUID key
      trxName - Transaction
    • MMFARegistration

      public MMFARegistration(Properties ctx, int MFA_Registration_ID, String trxName)
      Read/Create empty MFA Registration
      Parameters:
      ctx - context
      MFA_Registration_ID - ID
      trxName - transaction
    • MMFARegistration

      public MMFARegistration(Properties ctx, ResultSet rs, String trxName)
      Read MFA Registration from current row in ResultSet
      Parameters:
      ctx - context
      rs - ResultSet
      trxName - transaction
  • Method Details

    • alreadyExistsValid

      public static boolean alreadyExistsValid(MMFAMethod method, String prm)
      Validate if a method is already registered for this user
      Parameters:
      method -
      prm -
      Returns:
      true if valid registration exists
    • invalidatePreviousPending

      public static void invalidatePreviousPending(MMFAMethod method, String prm, MMFARegistration reg)
      Mark previous invalid registration as inactive.
      Parameters:
      method -
      prm -
      reg -
    • setIsUserMFAPreferred

      public void setIsUserMFAPreferred(boolean IsUserMFAPreferred)
      Set record as preferred, and set all the others from this user as not preferred
      Specified by:
      setIsUserMFAPreferred in interface I_MFA_Registration
      Overrides:
      setIsUserMFAPreferred in class X_MFA_Registration
      Parameters:
      IsUserMFAPreferred - Preferred
    • getValidRegistrationsFromUser

      public static List<MMFARegistration> getValidRegistrationsFromUser()
      Get the valid registrations from this user
      Returns:
      list of valid registrations
    • userHasValidRegistration

      public static boolean userHasValidRegistration()
      If the user has valid registration mechanisms
      Returns:
      true if user has valid registration
    • generateValidationCode

      public String generateValidationCode(MMFARegistration reg)
      Generate a validation code using the registered method
      Parameters:
      reg - registration record
      Returns:
      validation code
    • validateCode

      public String validateCode(MMFARegistration reg, String code, boolean setPreferred)
      Validate the code using the registered method
      Parameters:
      reg - registration record
      code - validation code
      setPreferred -
      Returns:
      message on error, null when OK