Fido2ApiClient

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

The entry point for interacting with the regular app Fido2 APIs.

Inherited Field Summary

Public Method Summary

Task<Fido2PendingIntent>
getRegisterIntent(PublicKeyCredentialCreationOptions requestOptions)
Creates a Task with Fido2PendingIntent, 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>
getSignIntent(PublicKeyCredentialRequestOptions requestOptions)
Creates a Task with Fido2PendingIntent, when started, will issue a Fido2 signature request for a relying party to authenticate a user.

Inherited Method Summary

Public Methods

public Task<Fido2PendingIntent> getRegisterIntent (PublicKeyCredentialCreationOptions requestOptions)

Creates a Task with Fido2PendingIntent, 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 = mFido2ApiClient.getRegisterIntent(requestOptions);
 ...
 result.addOnSuccessListener(
      new OnSuccessListener() {
        @Override
        public void onSuccess(Fido2PendingIntent fido2PendingIntent) {
          if (fido2PendingIntent.hasPendingIntent()) {
            // Start a FIDO2 registration request.
            fido2PendingIntent.launchPendingIntent(this, REGISTER_REQUEST_CODE);
          }
        }
      });
 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)

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


 Task result = mFido2ApiClient.getSignIntent(requestOptions);
 ...
 result.addOnSuccessListener(
      new OnSuccessListener() {
        @Override
        public void onSuccess(Fido2PendingIntent fido2PendingIntent) {
          if (fido2PendingIntent.hasPendingIntent()) {
            // Start a FIDO2 sign request.
            fido2PendingIntent.launchPendingIntent(this, SIGN_REQUEST_CODE);
          }
        }
      });
 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