The App SDK provides a default UI for registering OTP and Photo ID authentication methods implemented as a Fragment.
.png?sv=2026-02-06&spr=https&st=2026-09-30T03%3A55%3A03Z&se=2026-09-30T04%3A06%3A03Z&sr=c&sp=r&sig=LeRFgGDCzhlkrvqVl%2FhLKwmJQ3cI7xj1Q8VlK3ZGGes%3D)
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 this Fragment. Your fragment (View or Fragment in the sequence diagram below) responds to user input by calling the RegistrationController (Controller) functions to trigger the required functionality such as registering a non-FIDO authenticator (Model). The RegistrationController calls back to your Fragment to show the updates.
To provide your own UI:
Implement your own custom Fragment class that extends the BaseAdaptiveRegFragment class.
For your Fragment to receive notifications from the Registration Controller, the App SDK provides class RegistrationViewModel. This class is called 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(RegistrationViewModel::class.java)Implement your own custom factory extending the AdaptiveRegUIFactory class. For example, call it SampleAdaptiveRegUIFactory.
Initialize the SDK to use your custom UI factory by making the following call: AdaptiveRegUIFactory.setInstance(SampleAdaptiveRegUIFactory())
The following diagram illustrates the MVC flow when the user registers a method.
.png?sv=2026-02-06&spr=https&st=2026-09-30T03%3A55%3A03Z&se=2026-09-30T04%3A06%3A03Z&sr=c&sp=r&sig=LeRFgGDCzhlkrvqVl%2FhLKwmJQ3cI7xj1Q8VlK3ZGGes%3D)
The steps in this diagram are described below:
Your application calls AdaptiveUI.getRegistrationFragment().
AdaptiveUI calls the createFragment() method of your custom AdaptiveRegUIFactory to obtain the instance of your custom BaseAdaptiveRegFragment class.
Your application shows the instance of BaseAdaptiveRegFragment it just obtained.
Once your Fragment is initialized, it calls onRefresh() from class RegistrationController.
The Registration Controller calls the Server to get the list of authenticators for the user.
The Registration 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 Fragment displays the list of authenticators.
The user selects an authenticator to add.
Your Fragment calls the Registration Controller's onAdd() with the selected authenticator.
The Registration Controller performs the registration on the selected authenticator.
The Registration 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 BaseAdaptiveRegFragment, AdaptiveUI, AdaptiveRegUIFactory, RegistrationController, RegistrationViewModel classes for more details.
Working Example in Tutorial App
Refer to file SampleAdaptiveRegFragment.kt and SampleAdaptiveRegUIFactory.kt for an example implementation.