The App SDK provides a default UI for FIDO UAF/ FIDO2 registration implemented as two fragments.
Default FIDO2 Fragment |
Default UAF Fragment |
This registration uses the Model-View-Controller (MVC) architecture, which makes it easy to replace the UI without having to reimplement the core logic. To use your own UI, you need to provide your own implementation of these fragments. Your Fragment (View or Fragment in the sequence diagram below) responds to user input by calling the FidoRegistrationController functions (Controller) to trigger the required functionality such as registering an authenticator (Model). The FidoRegistrationController calls back to your fragment to show the updates.
To replace the FIDO registration UI:
Implement your own custom Fragment class that extends BaseFidoRegFragment.
Important: For your Fragment to receive notifications from the Fido Registration Controller, the App SDK provides class FidoRegistrationViewModel. This class is called FIDO Registration Live Data in the diagram below. Include the following code in your Fragment so that the controller notifies your Fragment when it needs to update its list of authentication methods:
mModel = ViewModelProvider(this).get(FidoRegistrationViewModel::class.java)Implement your own custom UI factory that extends FidoRegUIFactory. For example, call it SampleFidoRegUIFactory.
Initialize the SDK to use your custom factory by making the following call: FidoRegUIFactory.setInstance(SampleFidoRegUIFactory())
The following diagram illustrates the MVC flow when the user registers a FIDO authentication method. The yellow boxes represent your code.
.png?sv=2026-02-06&spr=https&st=2026-09-30T03%3A54%3A59Z&se=2026-09-30T04%3A06%3A59Z&sr=c&sp=r&sig=5pdcyqbPwiiyAGQDzcfZwwPM3zoZbCyUALug4fqZJS0%3D)
The steps in this diagram are described below:
Your application calls the getRegistrationFragment() from AppSDKPlus to obtain the instance of your custom BaseFidoRegFragment.
The App SDK calls the createFragment() method of your custom FidoRegUIFactory to obtain the instance of your custom BaseFidoRegFragment.
Your application attaches your custom BaseFidoRegFragment onto its own Activity.
Once your Fragment is initialized, your Fragment calls the Controller's onRefresh().
The Controller calls the Server to get the list of authentication methods for the user.
The Controller calls the Live Data's setMethods() with the list of authenticators.
When Live Data’s setMethods() is called, the observer on your Fragment is notified and the observer’s callback function is called.
Your View displays the list of authentication methods.
The user selects a method to register.
Your View calls the Controller's onRegister() with the selected method.
The Controller performs the registration on the selected authentication method.
On completion of the registration, the Controller calls the Live Data's onOperationCompleted().
When Live Data’s onOperationCompleted() is called, the observer on your Fragment is notified and the observer’s callback function is called.
Refer to the Client API Docs for the BaseFidoRegFragment, FidoRegUIFactory, FidoRegistrationController and FidoRegistrationViewModel classes.
Working Examples in Tutorial App
Refer to files SampleRegFragment.kt and SampleFidoRegUIFactory.kt for an example implementation.
.png?sv=2026-02-06&spr=https&st=2026-09-30T03%3A54%3A59Z&se=2026-09-30T04%3A06%3A59Z&sr=c&sp=r&sig=5pdcyqbPwiiyAGQDzcfZwwPM3zoZbCyUALug4fqZJS0%3D)
.jpg?sv=2026-02-06&spr=https&st=2026-09-30T03%3A54%3A59Z&se=2026-09-30T04%3A06%3A59Z&sr=c&sp=r&sig=5pdcyqbPwiiyAGQDzcfZwwPM3zoZbCyUALug4fqZJS0%3D)