Class MechanismRegistrationHelper

java.lang.Object
com.tivoli.am.fim.registrations.MechanismRegistrationHelper

public class MechanismRegistrationHelper extends Object
Convenience helper to simplify/standardize retrieval and processing of 2FA registrations.
  • Constructor Details

    • MechanismRegistrationHelper

      public MechanismRegistrationHelper()
  • Method Details

    • getRegistrationsForUser

      public static MechanismList getRegistrationsForUser(String username)
      Fetches the list of registrations associated with the supplied user. Uses the default Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      Returns:
      A list of Mechanisms associated with the user as a MechanismList.
    • getRegistrationsForUser

      public static MechanismList getRegistrationsForUser(String username, String locale)
      Fetches the list of registrations for the supplied user. Uses the supplied Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      locale - The locale to use in case of error messages.
      Returns:
      A list of Mechanisms associated with the user as a MechanismList.
    • getRegistrationsForUser

      public static MechanismList getRegistrationsForUser(String username, String locale, String totpNamespace, String hotpNamespace)
      Fetches the list of registrations for the supplied user. Uses the supplied Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      locale - The locale to use in case of error messages.
      totpNamespace - The namespace used to store the TOTP secret key.
      hotpNamespace - The namespace used to store the HOTP secret key.
      Returns:
      A list of Mechanisms associated with the user as a MechanismList.
    • getRegistrationsForUser

      public static MechanismList getRegistrationsForUser(String username, CiServerConnection conn)
      Fetches the list of registrations for the supplied user. Includes any IBM Verify mechanisms using the supplied CiServerConnection. Uses the default Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      conn - The CiServerConnection to use for all network calls to IBM Verify.
      Returns:
      A list of Mechanisms associated with the user as a MechanismList.
    • getRegistrationsForUser

      public static MechanismList getRegistrationsForUser(String username, String locale, CiServerConnection conn)
      Fetches the list of registrations for the supplied user. Includes any IBM Verify mechanisms using the supplied CiServerConnection. Uses the supplied Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      locale - The locale to use in case of error messages.
      conn - The CiServerConnection to use for all network calls to IBM Verify.
      Returns:
      A list of Mechanisms associated with the user as a MechanismList.
    • getRegistrationsForUser

      public static MechanismList getRegistrationsForUser(String username, String locale, CiServerConnection conn, String totpNamespace, String hotpNamespace)
      Fetches the list of registrations for the supplied user. Includes any IBM Verify mechanisms using the supplied CiServerConnection. Uses the supplied Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      locale - The locale to use in case of error messages.
      conn - The CiServerConnection to use for all network calls to IBM Verify.
      totpNamespace - The namespace used to store the TOTP secret key.
      hotpNamespace - The namespace used to store the HOTP secret key.
      Returns:
      A list of Mechanisms associated with the user as a MechanismList.
    • getCloudRegistrationsForUser

      public static CloudMechanism[] getCloudRegistrationsForUser(String username, CiServerConnection conn)
      Fetches an array of IBM Verify Registrations for the supplied user in the CI instance supplied. Uses the default Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      conn - The CiServerConnection to use for all network calls to IBM Verify.
      Returns:
      An array of CloudMechanism for the user. An empty array indicates that no IBM Verify registrations exist for the user.
    • getCloudRegistrationsForUser

      public static CloudMechanism[] getCloudRegistrationsForUser(String username, String locale, CiServerConnection conn)
      Fetches an array of IBM Verify Registrations for the supplied user in the CI instance supplied. Uses the supplied Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      locale - The locale to use in case of error messages.
      conn - The CiServerConnection to use for all network calls to IBM Verify.
      Returns:
      An array of CloudMechanism for the user. An empty array indicates that no IBM Verify registrations exist for the user.
    • getFidoRegistrationsForUser

      public static FIDORegistration[] getFidoRegistrationsForUser(String username)
      Fetches an array of FIDO Registrations for the supplied user. Uses the default Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      Returns:
      An array of FIDORegistration for the user. An empty array indicates that no FIDO registrations exist for the user.
    • getFidoRegistrationsForUser

      public static FIDORegistration[] getFidoRegistrationsForUser(String username, String locale)
      Fetches an array of FIDO Registrations for the supplied user. Uses the supplied Locale.
      Parameters:
      username - The username of the user to fetch registrations for.
      locale - The locale to use in case of error messages.
      Returns:
      An array of FIDORegistration for the user. An empty array indicates that no FIDO registrations exist for the user.
    • getMmfaRegistrationsForUser

      public static MMFARegistration[] getMmfaRegistrationsForUser(String username)
      Fetches an array of MMFA Registrations for the supplied user
      Parameters:
      username - The username of the user to fetch registrations for.
      Returns:
      An array of MMFARegistration for the user. An empty array indicates that no MMFA registrations exist for the user.
    • getEulaStatusForUser

      public static EULAStatus[] getEulaStatusForUser(String username)
      Fetches an array of EULAStatus for the supplied user.
      Parameters:
      username - The username of the user to fetch status of EULA for.
      Returns:
      An array of EULAStatus for the user. An empty array indicates that no EULA's have been accepted by the user.
    • isHotpEnrolled

      public static boolean isHotpEnrolled(String username)
      Fetches the HOTP enrollment status of the user Uses the default Locale.
      Parameters:
      username - The username of the user to perform this check for.
      Returns:
      A boolean indicating if the user has HOTP enrolled.
    • isHotpEnrolled

      public static boolean isHotpEnrolled(String username, String locale)
      Fetches the HOTP enrollment status of the user Uses the supplied Locale.
      Parameters:
      username - The username of the user to perform this check for.
      locale - The locale to use in case of error messages.
      Returns:
      A boolean indicating if the user has HOTP enrolled.
    • isHotpEnrolled

      public static boolean isHotpEnrolled(String username, String locale, String namespace)
      Fetches the HOTP enrollment status of the user Uses the supplied Locale.
      Parameters:
      username - The username of the user to perform this check for.
      locale - The locale to use in case of error messages.
      namespace - The namespace used to store the HOTP secret key.
      Returns:
      A boolean indicating if the user has HOTP enrolled.
    • isTotpEnrolled

      public static boolean isTotpEnrolled(String username)
      Fetches the TOTP enrollment status of the user Uses the default Locale.
      Parameters:
      username - The username of the user to perform this check for.
      Returns:
      A boolean indicating if the user has TOTP enrolled.
    • isTotpEnrolled

      public static boolean isTotpEnrolled(String username, String locale)
      Fetches the TOTP enrollment status of the user Uses the supplied Locale.
      Parameters:
      username - The username of the user to perform this check for.
      locale - The locale to use in case of error messages.
      Returns:
      A boolean indicating if the user has TOTP enrolled.
    • isTotpEnrolled

      public static boolean isTotpEnrolled(String username, String locale, String namespace)
      Fetches the TOTP enrollment status of the user Uses the supplied Locale.
      Parameters:
      username - The username of the user to perform this check for.
      locale - The locale to use in case of error messages.
      namespace - The namespace used to store the TOTP secret key.
      Returns:
      A boolean indicating if the user has TOTP enrolled.
    • isKQEnrolled

      public static boolean isKQEnrolled(String username)
      Fetches the Knowledge Question enrollment status of the user Uses the default Locale.
      Parameters:
      username - The username of the user to perform this check for.
      Returns:
      A boolean indicating if the user has any Knowledge Questions enrolled.
    • isKQEnrolled

      public static boolean isKQEnrolled(String username, String locale)
      Fetches the Knowledge Question enrollment status of the user Uses the supplied Locale.
      Parameters:
      username - The username of the user to perform this check for.
      locale - The locale to use in case of error messages.
      Returns:
      A boolean indicating if the user has Knowledge Questions enrolled.
    • getMMFATransactions

      public static MMFATransactionData[] getMMFATransactions(String user)
      List all of the MMFA transactions for a user.
      Parameters:
      user - The username that transactions should be fetched for
      Returns:
      A list of 0 or more MMFA transactions.
    • getMMFATransaction

      public static MMFATransactionData getMMFATransaction(String txnId)
      Return the MMFA transaction data for a given transaction id.
      Parameters:
      txnId - The unique identifier of the MMFA transaction.
      Returns:
      The transaction data or null if the transaction could not be found.