Interface Fido2Client


public interface Fido2Client
The main entry point for interacting with the FIDO2 SDK.

This client is responsible for processing FIDO2 registration and authentication requests from a Relying Party and generating the corresponding responses. It orchestrates the interaction with the various authenticators available on the device.

Since:
1.0.0
  • Method Details

    • respondWithArgs

      @NonNull Fido2ResponseTask respondWithArgs(@NonNull Fido2RespondArgs respondArgs, @NonNull Fido2ResponseCallback responseCallback)
      Asynchronously processes a FIDO2 request and generates a FIDO2 response.

      This is the primary method for handling FIDO2 operations. The operation may be long-running and involves user interaction. All UI-related tasks, such as displaying prompts or authenticator selection lists, are delegated to the callbacks provided in the Fido2RespondArgs.

      Parameters:
      respondArgs - The arguments required to process the request, including the Fido2Request and UI callbacks. Must not be null.
      responseCallback - The callback to be invoked with the Fido2Response on success or a Fido2Exception on failure. Must not be null.
      Returns:
      A Fido2ResponseTask that can be used to cancel the ongoing operation.
      Since:
      1.0.0
    • authenticatorRegistrations

      @NonNull @WorkerThread List<Fido2AuthenticatorRegistrationInfo> authenticatorRegistrations()
      Retrieves a list of all FIDO2 credential registrations stored by the SDK.

      This method should be called on a background thread to avoid blocking the UI.

      Returns:
      A List of Fido2AuthenticatorRegistrationInfo objects, each representing a registered credential. Returns an empty list if no credentials are registered.
      Since:
      1.0.0
    • getAuthenticatorRegistrations

      @WorkerThread List<Fido2AuthenticatorRegistrationInfo> getAuthenticatorRegistrations(@NonNull String userId)
      Retrieves a list of FIDO2 credential registrations for a specific user ID.

      This method should be called on a background thread.

      Parameters:
      userId - The user ID for which to retrieve registrations. Must not be null.
      Returns:
      A List of Fido2AuthenticatorRegistrationInfo for the specified user. Returns an empty list if no credentials are found for that user.
      Since:
      1.6.0
    • deleteAuthenticatorRegistration

      void deleteAuthenticatorRegistration(@NonNull Fido2AuthenticatorRegistrationInfo authenticatorRegistration) throws Fido2Exception
      Deletes a specific FIDO2 credential registration.
      Parameters:
      authenticatorRegistration - The registration information of the credential to delete. Must not be null.
      Throws:
      Fido2Exception - if an error occurs, such as an unsafe environment being detected.
      Since:
      1.0.0
    • reset

      void reset() throws Fido2Exception
      Deletes all FIDO2 credential registrations and resets the state of all authenticators.

      This is a destructive operation that will remove all stored credentials. For authenticators that require enrollment (like the Passcode Authenticator), this will also remove the enrollment, requiring the user to enroll again.

      Throws:
      Fido2Exception - if an error occurs, such as an unsafe environment being detected.
      Since:
      1.3.0
    • getSDKVersion

      static String getSDKVersion()
      Gets the version of the FIDO2 SDK.
      Returns:
      A string representing the SDK version.
      Since:
      1.2.0
    • setActivity

      void setActivity(@Nullable androidx.fragment.app.FragmentActivity activity)
      Sets the FragmentActivity to be used for UI-related flows.

      This is required for operations that display system UI, such as those involving the Biometric prompt or platform authenticators (Google Passkeys).

      Parameters:
      activity - The FragmentActivity to use for displaying UI, or null to clear it.
      Since:
      4.0.0