Interface Fido2Client
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 Summary
Modifier and TypeMethodDescriptionRetrieves a list of all FIDO2 credential registrations stored by the SDK.voiddeleteAuthenticatorRegistration(Fido2AuthenticatorRegistrationInfo authenticatorRegistration) Deletes a specific FIDO2 credential registration.getAuthenticatorRegistrations(String userId) Retrieves a list of FIDO2 credential registrations for a specific user ID.static StringGets the version of the FIDO2 SDK.voidreset()Deletes all FIDO2 credential registrations and resets the state of all authenticators.respondWithArgs(Fido2RespondArgs respondArgs, Fido2ResponseCallback responseCallback) Asynchronously processes a FIDO2 request and generates a FIDO2 response.voidsetActivity(androidx.fragment.app.FragmentActivity activity) Sets theFragmentActivityto be used for UI-related flows.
-
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 theFido2Requestand UI callbacks. Must not be null.responseCallback- The callback to be invoked with theFido2Responseon success or aFido2Exceptionon failure. Must not be null.- Returns:
- A
Fido2ResponseTaskthat can be used to cancel the ongoing operation. - Since:
- 1.0.0
-
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
ListofFido2AuthenticatorRegistrationInfoobjects, 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
ListofFido2AuthenticatorRegistrationInfofor 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
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
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 theFragmentActivityto 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- TheFragmentActivityto use for displaying UI, ornullto clear it.- Since:
- 4.0.0
-