Interface OsAuthenticationListenHandler
Authenticator.BIOMETRIC_AUTHENTICATOR_AAID
,
Authenticator.DEVICE_PASSCODE_AUTHENTICATOR_AAID
and the
Authenticator.FINGERPRINT_AUTHENTICATOR_AAID
authenticators.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancels the authentication operation.Pauses listening for OS credentials.Resumes listening for OS credentials.
-
Method Details
-
cancelAuthentication
void cancelAuthentication()Cancels the authentication operation. This will result in the operation being canceled and anOperationError
or aOperationError
with aFidoErrorCode.USER_CANCELED
will be returned. -
pauseListening
OsAuthenticationListenHandler pauseListening()Pauses listening for OS credentials.If the application is listening for OS credentials, and it is brought to the background, then the operating system will cancel automatically listening for credentials and will send an error. This method must be invoked when the application is brought to the background before the OS cancels the authentication and the SDK sends an error.
Invoking this method will have effect only if
cancelAuthentication()
was not previously invoked.The method can be invoked from the
onPause()
lifecycle method of your fragment, activity or LifecycleObserver. Note that this approach does not work in some devices (in these devices theonPause
method is invoked after the OS cancels the authentication).For example:
private OsAuthenticationListenHandler osAuthenticationListenHandler; [...] @Override public void onPause() { if (osAuthenticationListenHandler != null) { osAuthenticationListenHandler = osAuthenticationListenHandler.pauseListening(); } }
- Returns:
- the
OsAuthenticationListenHandler
to handle the new listening
-
resumeListening
OsAuthenticationListenHandler resumeListening()Resumes listening for OS credentials.If the application is listening for OS credentials, and it is brought to the background, then the operating system will cancel automatically listening for credentials. This method must be invoked when the application is brought to the foreground again to resume listening for credentials.
Invoking this method will have effect only if
cancelAuthentication()
was not previously invoked.The method is typically invoked from the
onResume()
lifecycle method of your fragment, activity or LifecycleObserver. For example:private OsAuthenticationListenHandler osAuthenticationListenHandler; [...] @Override public void onResume() { if (osAuthenticationListenHandler != null) { osAuthenticationListenHandler = osAuthenticationListenHandler.resumeListening(); } }
Note: invoking this method after
FingerprintUserVerificationHandler.listenForOsCredentials()
or invoking this method sequentially without the application being sent to the background might result in recoverable errors being returned (seeFingerprintUserVerificationContext.lastRecoverableError()
) depending on the fingerprint hardware used. That is why this method should only be invoked after the application is brought back from background.- Returns:
- the
OsAuthenticationListenHandler
to handle the new listening
-