Class PasscodeAuthenticator

java.lang.Object
com.thalesgroup.gemalto.fido2.authenticator.passcode.PasscodeAuthenticator

public abstract class PasscodeAuthenticator extends Object
Manages the lifecycle of the Passcode Authenticator.

This class provides methods to create, change, and delete a user's passcode.

Note: A user must create a passcode before this authenticator can be used for FIDO2 operations.

Since:
1.0.0
  • Constructor Details

    • PasscodeAuthenticator

      public PasscodeAuthenticator()
  • Method Details

    • of

      @AnyThread public static PasscodeAuthenticator of(@NonNull androidx.fragment.app.FragmentActivity activity, @NonNull PasscodeAuthenticatorCallback callback)
      Gets an instance of the PasscodeAuthenticator.
      Parameters:
      activity - The FragmentActivity required for UI operations and context. Must not be null.
      callback - The callback to receive events about the outcome of passcode management operations. Must not be null.
      Returns:
      A new instance of PasscodeAuthenticator.
      Since:
      1.0.0
    • createPasscode

      @AnyThread public abstract void createPasscode()
      Starts the asynchronous process to create a new passcode.

      The user must create a passcode to use this authenticator for FIDO2 operations. The result of the operation is delivered via the PasscodeAuthenticatorCallback.

      Since:
      1.0.0
    • deletePasscode

      @AnyThread public abstract void deletePasscode()
      Starts the asynchronous process to delete the user's existing passcode.

      User authentication is required before the passcode can be deleted.

      Upon successful deletion, all FIDO2 registrations associated with this authenticator will be invalidated. The user will need to create a new passcode to use this authenticator again. The result of the operation is delivered via the PasscodeAuthenticatorCallback.

      Since:
      1.0.0
    • isPasscodeCreated

      @AnyThread public abstract boolean isPasscodeCreated()
      Synchronously checks if a passcode has been created for this authenticator.

      Use this method to determine if the user needs to be prompted to create a passcode.

      Returns:
      true if a passcode exists, false otherwise.
      Since:
      1.0.0
    • changePasscode

      @AnyThread public abstract void changePasscode()
      Starts the asynchronous process to change the existing passcode.

      This process requires the user to first authenticate with their old passcode, and then enter and confirm a new one. The result of the operation is delivered via the PasscodeAuthenticatorCallback.

      Since:
      1.0.0
    • getLockoutExpiryTimestamp

      @WorkerThread public abstract long getLockoutExpiryTimestamp() throws Fido2Exception
      Gets the timestamp for when the current lockout period will expire.
      Returns:
      The lockout expiry timestamp in milliseconds since the Unix epoch. Returns 0 if the authenticator is not currently locked out.
      Throws:
      Fido2Exception - Exception when unsafe environment detected.
      Since:
      1.3.0