Interface KeyboardCallback
public interface KeyboardCallback
A callback for receiving events from the secure keyboard.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationFailed(int retryCountRemaining) Called when a passcode authentication attempt fails but the user still has attempts remaining.voidonKeyReceived(KeyboardKey key) Called when a key is pressed on the keyboard.voidonPasscodeRuleFailed(Fido2Exception exception) Called when the passcode input on the keyboard fails the passcode rule validation.voidonUsageChanged(KeyboardUsage usage) Called when the purpose of the keyboard changes (e.g., from entering a new passcode to confirming it).
-
Method Details
-
onKeyReceived
Called when a key is pressed on the keyboard.The application should use this callback to update its UI, such as displaying dots for each entered digit.
Key examples include:
This method is called on the main thread.
KeyboardKey.INPUT- Add a new secure character (⬤) to the text field entry.
KeyboardKey.DELETE- Remove a secure character from the text field entry.
KeyboardKey.DONE- Passcode entry is submitted to the FIDO SDK.- Parameters:
key- An enum of typeKeyboardKeyindicating the type of key pressed.- Since:
- 1.0.0
-
onAuthenticationFailed
@MainThread void onAuthenticationFailed(int retryCountRemaining) Called when a passcode authentication attempt fails but the user still has attempts remaining.The retry count limit is configured via
Fido2Config.setMaximumRetryCount(int). If the user exceeds this limit, aFido2Exceptionwith the error codeFido2ErrorCode.ERROR_USER_LOCKOUTis thrown. The retry count resets upon a successful authentication.The entered passcode is automatically cleared after a failed attempt.
This method is called on the main thread.- Parameters:
retryCountRemaining- The number of remaining authentication attempts.- Since:
- 1.0.0
-
onPasscodeRuleFailed
Called when the passcode input on the keyboard fails the passcode rule validation.This method is called on the main thread.
- Parameters:
exception- AFido2Exceptioncontaining aPasscodeRuleExceptionas its cause, which provides details about the specific rule violation.- Since:
- 1.3.0
-
onUsageChanged
Called when the purpose of the keyboard changes (e.g., from entering a new passcode to confirming it). This method is called on the main thread.- Parameters:
usage- An enum of typeKeyboardUsageindicating what the keyboard is used for- Since:
- 1.0.0
-