Fido2ApiClient

public class Fido2ApiClient extends GoogleApi<Api.ApiOptions.NoOptions>

The entry point for interacting with FIDO2 APIs.

Public Method Summary

Task<Fido2PendingIntent>
Task<PendingIntent>
getRegisterPendingIntent(PublicKeyCredentialCreationOptions requestOptions)
Creates a Task with PendingIntent, when started, will issue a FIDO2 registration request, which is done once per FIDO2 device per account for associating the new FIDO2 device with that account.
Task<Fido2PendingIntent>
Task<PendingIntent>
getSignPendingIntent(PublicKeyCredentialRequestOptions requestOptions)
Creates a Task with PendingIntent, when started, will issue a FIDO2 signature request for a relying party to authenticate a user.
Task<Boolean>
isUserVerifyingPlatformAuthenticatorAvailable()
Creates a Task with Boolean, which check if a user verifying platform authenticator is available on the device.

Inherited Method Summary

Public Methods

public Task<Fido2PendingIntent> getRegisterIntent (PublicKeyCredentialCreationOptions requestOptions)

public Task<PendingIntent> getRegisterPendingIntent (PublicKeyCredentialCreationOptions requestOptions)

Creates a Task with PendingIntent, when started, will issue a FIDO2 registration request, which is done once per FIDO2 device per account for associating the new FIDO2 device with that account. For example:


 Task result = fido2ApiClient.getRegisterPendingIntent(requestOptions);
 ...
 result.addOnSuccessListener(
      new OnSuccessListener() {
        @Override
        public void onSuccess(PendingIntent pendingIntent) {
          if (pendingIntent != null) {
            // Start a FIDO2 registration request.
            activity.startIntentSenderForResult(
              pendingIntent.getIntentSender(),
              REGISTER_REQUEST_CODE,
              null // fillInIntent,
              0 // flagsMask,
              0 // flagsValue,
              0 //extraFlags);
          }
        }
      });
 result.addOnFailureListener(
     new OnFailureListener() {
       @Override
       public void onFailure(Exception e) {
         // Fail
       }
     }
 
Parameters
requestOptions for the registration request
Returns
  • Task with PendingIntent to launch FIDO2 registration request

public Task<Fido2PendingIntent> getSignIntent (PublicKeyCredentialRequestOptions requestOptions)

This method is deprecated.
use getSignPendingIntent(PublicKeyCredentialRequestOptions) instead

public Task<PendingIntent> getSignPendingIntent (PublicKeyCredentialRequestOptions requestOptions)

Creates a Task with PendingIntent, when started, will issue a FIDO2 signature request for a relying party to authenticate a user. For example:


 Task result = fido2ApiClient.getSignPendingIntent(requestOptions);
 ...
 result.addOnSuccessListener(
      new OnSuccessListener() {
        @Override
        public void onSuccess(PendingIntent pendingIntent) {
          if (pendingIntent != null) {
            // Start a FIDO2 sign request.
            activity.startIntentSenderForResult(
               pendingIntent.getIntentSender(),
               SIGN_REQUEST_CODE,
               null, // fillInIntent
               0, // flagsMask
               0, // flagsValue
               0); //extraFlags
          }
        }
      });
 result.addOnFailureListener(
     new OnFailureListener() {
       @Override
       public void onFailure(Exception e) {
         // Fail
       }
     }
 
Parameters
requestOptions for the sign request
Returns
  • Task with PendingIntent to launch FIDO2 signature request

public Task<Boolean> isUserVerifyingPlatformAuthenticatorAvailable ()

Creates a Task with Boolean, which check if a user verifying platform authenticator is available on the device.