Enabling or Disabling Authentication Types Flow for Android

casan141saas
A user can enable or disable specific authentication types from the list of authentication types that are supported by the SDK.
This section covers the following topics:
For information about the APIs mentioned in these topics, see API Reference for Android.
Sample App Screenshot for the Enabling or Disabling Authentication Types Flow
The following steps take place when a user enables or disables authentication types:
  1. The user opens the app.
  2. The user taps the menu in the upper-right corner of the page
  3. In the menu, the user taps Manage authentication types.
    Enable_Disable_01_Menu.png
  4. The app displays the authentication types that are currently supported by the SDK.
    As shown in this screenshot, the PIN authentication type cannot be disabled.
    Enable_Disable_02_Auth_Types.png
  5. The user enables or disables authentication types according to her requirements. In the example shown in the previous screenshot, the user can disable biometric authentication (that is, fingerprint authentication).
    If the user enables biometric authentication, then the user is prompted to submit her PIN for authentication. After the PIN is verified, the SDK enables biometric authentication.
Enabling or Disabling Authentication Types Flow Diagram
The following flow diagram shows the sequence of API calls that take place when the user uses the Enabling or Disabling Authentication Types flow.
Enabling or Disabling Authentication Types Flow
Enabling or Disabling Authentication Types Flow
Sample Code for the Enabling or Disabling Authentication Types Flow
The following is sample code for the Enabling or Disabling Authentication Types flow:
//Call the getAllAuthenticationModes to get the available authentication modes AuthenticationHandler handler = new AuthenticationHandler(this); ArrayList<Authentication> authenticationModes = handler.getAllAuthenticationModes(); //App displays list of authentications with the Authentication types and their status //App collects user's updates (disable or enable) of specific authentication mode //App prepares the Authentication instance. //If the user disables biometric authentication, then app calls the following API boolean updateStatus = handler.updateAuthenticationType(authentication, null); // If the user enables biometric authentication, then app prompts for the PIN, verifies the PIN, and then directly calls the following API ... VerifyPinResponse verifyPinResponse = handler.verifyPin(pin); if (verifyPinResponse.getStatus().equals("SUCCESS")) { boolean updateStatus = handler.updateAuthenticationType(authentication, pin); } //App calls updateAuthenticationType() to update the single authentication instance value into the Database. boolean updateStatus = handler.updateAuthenticationType(authentication);