During a FIDO2 authentication operation, the server tries to determine if your device has a FIDO2 registration. In some cases the server finds a registration, but it can't determine if the registration is on the current device or on a different device. In this case the App SDK uses the built-in Try Passwordless UI to inform the user with one of the following dialogs:
There are two ways to modify this UI, you can either suppress its display or replace it.
Suppress the display of the Try Passwordless dialog
To prevent the display of the default UI, create the extension data:
var ext: [String : Any] = [:]
ext[AUTHENTICATOR_EXTENSIONS_KEY_ID] = "noknok.skipTryFido"
ext[AUTHENTICATOR_EXTENSIONS_KEY_DATA] = "true"
ext[AUTHENTICATOR_EXTENSIONS_KEY_FAIL_IF_UNKNOWN] = falsePass this extension data inside extras to the NNLAdaptiveUI.getAuthenticationView() method.
Working Example in Tutorial App
Refer to how the variable skipTryFido is used in AppDelegate.swift and LoginViewController.swift.
Replace the Try Passwordless dialog
In order to replace these default dialogs with your own custom UI, your custom UI class must adopt the ITryFidoUi protocol. In addition, an object of the Digipass S3 default UI class is created by the Digipass S3 TryFidoUiFactory. Therefore, you must define your own factory class to create objects of your custom UI.
Take these steps to define your custom UI classes and your custom factory class:
Create custom classes that implement your UI.
Declare that your custom UI classes adopt the ITryFidoUi protocol. To satisfy this protocol, define the following method in your custom UI classes: openUI().
Define a new factory class which adopts the ITryFidoUiFactory protocol. For example, call this new class SampleTryFidoUiFactory. To satisfy the ITryFidoUiFactory protocol, define the following methods in your class: SampleTryFidoUiFactory: createTryFidoUi().
SampleTryFidoUiFactory: createTryHybridUi().Refer to SampleTryFidoUiFactory.swift in the Tutorial App for details on how to write the createTryFidoUi() and createTryHybridUi() methods.
Inside AppDelegate.swift, set your SampleTryFidoUiFactory class to the TryFidoUiFactory instance.
let sampleTryFidoUiFactory = SampleTryFidoUiFactory()
TryFidoUiFactory.setInstance(sampleTryFidoUiFactory)Refer to the Client API Docs for the ITryFidoUi protocol, the ITryFidoUiFactory protocol, and the TryFidoUiFactory class for more details.
Working Example in Tutorial App
Refer to files SampleTryFidoUiFactory.swift and SampleTryFidoUi.swift for an example implementation.
Set the following value to true in the file AppDelegate.swift:
let useSampleTryFidoUI = true