Class PasscodeAuthenticator
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidStarts the asynchronous process to change the existing passcode.abstract voidStarts the asynchronous process to create a new passcode.abstract voidStarts the asynchronous process to delete the user's existing passcode.abstract longGets the timestamp for when the current lockout period will expire.abstract booleanSynchronously checks if a passcode has been created for this authenticator.static PasscodeAuthenticatorof(androidx.fragment.app.FragmentActivity activity, PasscodeAuthenticatorCallback callback) Gets an instance of thePasscodeAuthenticator.
-
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 thePasscodeAuthenticator.- Parameters:
activity- TheFragmentActivityrequired 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:
trueif a passcode exists,falseotherwise.- 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
Gets the timestamp for when the current lockout period will expire.- Returns:
- The lockout expiry timestamp in milliseconds since the Unix epoch. Returns
0if the authenticator is not currently locked out. - Throws:
Fido2Exception- Exception when unsafe environment detected.- Since:
- 1.3.0
-