Digipass S3 is now DigipassONE. This section is currently being updated to reflect our new name.

Replacing the FIDO registration UI

Prev Next

The App SDK provides a default UI for FIDO UAF/FIDO2 registration implemented as two Views.

Default UAF View

Default FIDO2 View

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 Views. Your view (View or Fragment in the sequence diagram below) responds to user input by calling the NNLFidoRegistrationController (Controller) functions to trigger the required functionality such as registering an authenticator (Model). The NNLFidoRegistrationController calls back to your View through the Live Data 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:

  • Implement your own custom View class, extending NNLBaseFidoRegViewController and adopting the NNLIFidoRegistrationLiveData protocol.

  • Implement your own custom UI factory, adopting the NNLIFidoRegUIFactory protocol. For example, call it SampleFidoRegUIFactory.

  • Initialize the SDK to use your custom factory by making the following call: NNLFidoRegUIFactory.setInstance(SampleFidoRegUIFactory()).

The following diagram illustrates the MVC flow when the user registers a FIDO authentication method. The yellow boxes represent your code.

The steps in this diagram are described below:

  1. Your application calls NNLAppSDKPlus.getFidoRegistrationView() to get an instance of your NNLBaseFidoRegViewController.

  2. The App SDK calls the NNLFidoRegUIFactory.getInstance().createViewController() to obtain the instance of your custom View.

  3. Your application displays your custom NNLBaseFidoRegViewController object (View).

  4. Your View calls the Controller's onRefresh().

  5. The Controller calls the Server to get the list of authenticators for the user.

  6. The Controller calls the Live Data's setMethods() with the list of authenticators.

  7. The Live Data object calls your View's setMethods() with the list.

  8. Your View displays the list of authentication methods.

  9. The user selects a method to register.

  10. Your View calls the Controller's onRegister() with the selected method.

  11. The Controller performs the registration on the selected authentication method.

  12. On completion of the registration, the Controller calls the Live Data's onOperationCompleted().

  13. The Live Data object calls your View's onOperationCompleted() so it can update the UI.

Refer to the Client API Docs for the NNLIFidoRegUIFactory and NNLIFidoRegistrationLiveData protocols and the NNLFidoRegistrationController and the NNLBaseFidoRegViewController classes for more details.

Working example in Tutorial app

  • Refer to files SampleFidoRegViewController.swift and SampleRegisterTableViewCell.swift for an example implementation.