Interface OsAuthenticationListenHandler


public interface OsAuthenticationListenHandler
An object that can be used to resume listening for OS credentials (i.e. fingerprint, face recognition) and to cancel the whole operation while listening for credentials. This is used with the Authenticator.BIOMETRIC_AUTHENTICATOR_AAID, Authenticator.DEVICE_PASSCODE_AUTHENTICATOR_AAID and the Authenticator.FINGERPRINT_AUTHENTICATOR_AAID authenticators.
See Also:
  • Method Details

    • cancelAuthentication

      void cancelAuthentication()
      Cancels the authentication operation. This will result in the operation being canceled and an OperationError or a OperationError with a FidoErrorCode.USER_CANCELED will be returned.
      See Also:
    • 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 for the SDK not to send an error.

      Invoking this method will have effect only if cancelAuthentication() was not previously invoked.

      The method is typically invoked from the onPause() lifecycle method of your fragment, activity or LifecycleObserver. For example:

       private OsAuthenticationListenHandler osAuthenticationListenHandler;
      
       [...]
      
       @Override
       public void onPause() {
           if (osAuthenticationListenHandler != null) {
               osAuthenticationListenHandler.pauseListening();
           }
       }
       
      Returns:
      the OsAuthenticationListenHandler to handle the new listening
    • 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 onPause() lifecycle method of your fragment, activity or LifecycleObserver. For example:

       private OsAuthenticationListenHandler osAuthenticationListenHandler;
      
       [...]
      
       @Override
       public void onResume() {
           if (osAuthenticationListenHandler != null) {
               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 (see FingerprintUserVerificationContext.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