U2fApiClient | Doclava
public class

U2fApiClient

extends GoogleApi<Api.ApiOptions.NoOptions>
java.lang.Object
   ↳ com.google.android.gms.common.api.GoogleApi<com.google.android.gms.common.api.Api.ApiOptions.NoOptions>
     ↳ com.google.android.gms.fido.u2f.U2fApiClient

Class Overview

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

Summary

Public Constructors
U2fApiClient(Activity activity)
U2fApiClient(Context context)
Public Methods
Task<U2fPendingIntent> getRegisterIntent(RegisterRequestParams requestParams)
Creates a Task with U2fPendingIntent.
Task<U2fPendingIntent> getSignIntent(SignRequestParams requestParams)
Creates a Task with U2fPendingIntent.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public U2fApiClient (Activity activity)

Parameters
activity Activity

public U2fApiClient (Context context)

Parameters
context Context

Public Methods

public Task<U2fPendingIntent> getRegisterIntent (RegisterRequestParams requestParams)

Creates a Task with U2fPendingIntent. When this Task object starts, it issues a U2F registration request. For example:


 Task result = mU2fApiClient.getRegisterIntent(registerRequestParams);
 ...
 result.addOnSuccessListener(
      new OnSuccessListener() {
        @Override
        public void onSuccess(U2fPendingIntent u2fPendingIntent) {
          if (U2fPendingIntent.hasPendingIntent()) {
            // Start a U2F registration request.
            u2fPendingIntent.launchPendingIntent(this, REGISTER_REQUEST_CODE);
          }
        }
      });
 result.addOnFailureListener(
     new OnFailureListener() {
       @Override
       public void onFailure(Exception e) {
         // Fail
       }
     }
 

Parameters
requestParams RegisterRequestParams:for the registration request

Returns
Task<U2fPendingIntent> Task with PendingIntent to launch U2F registration request

public Task<U2fPendingIntent> getSignIntent (SignRequestParams requestParams)

Creates a Task with U2fPendingIntent. When this Task object starts, it issues a U2F registration request. For example:


 Task result = mU2fApiClient.getSignIntent(registerRequestParams);
 ...
 result.addOnSuccessListener(
      new OnSuccessListener() {
        @Override
        public void onSuccess(U2fPendingIntent u2fPendingIntent) {
          if (U2fPendingIntent.hasPendingIntent()) {
            // Start a U2F sign request.
            u2fPendingIntent.launchPendingIntent(this, SIGN_REQUEST_CODE);
          }
        }
      });
 result.addOnFailureListener(
     new OnFailureListener() {
       @Override
       public void onFailure(Exception e) {
         // Fail
       }
     }
 

Parameters
requestParams SignRequestParams:for the sign request

Returns
Task<U2fPendingIntent> Task with PendingIntent to launch U2F signature request