onAuthenticationOptionsAvailable

šŸ”“ REL-ID SDK Event: onAuthenticationOptionsAvailable

🧭 Overview

The onAuthenticationOptionsAvailable event is triggered during the login process when the SDK needs to notify the app about the available authentication mechanisms for the user. This may include:

  • REL-ID Password
  • Device-based LDA (e.g., fingerprint, face, pattern)
  • Other configured options

šŸ“Œ Purpose

  • Allow the app to present available authentication options dynamically.
  • Enable the user to choose between options like Password and DeviceLDA.
  • Smoothly switch between password and biometric methods.

šŸ•’ When It’s Triggered

  • During login, once the session is initialized and options are determined.
  • When user is eligible for both LDA and password.
  • Will not trigger if only one method is configured (app will go straight to that challenge).

šŸ“¦ Sample Payload

{
  "userID": "test",
  "authenticationOptions": ["Password", "DeviceLDA"],
  "challengeMode": 0,
  "challengeResponse": {
    "status": {
      "statusCode": 100,
      "statusMessage": "Success."
    },
    "session": {
      "sessionType": 0,
      "sessionID": "XYZ123SESSIONID"
    },
    "additionalInfo": {
      "DNAProxyPort": 0,
      "isAdUser": 0,
      "JWT": "",
      "idvUserRole": "USER",
      "currentWorkFlow": "NormalLogin"
    },
    "challengeInfo": [
      { "key": "Response label", "value": "Password" },
      { "key": "SDK_CHLNG", "value": "YES" },
      { "key": "SDK_CHLNG_MODE", "value": "AUTO" },
      { "key": "ENABLE_FORGOT_PASSWORD", "value": "true" },
      { "key": "RELID_PASSWORD_POLICY", "value": "{...}" }
    ]
  },
  "error": {
    "longErrorCode": 0,
    "shortErrorCode": 0,
    "errorString": "Success"
  }
}

🧠 Fields

FieldDescription
userIDID of the logging-in user
authenticationOptionsList of available methods: "Password", "DeviceLDA", etc.
challengeModeIndicates type of challenge mode configured
challengeResponseStatus, session, and challenge info from the server
errorSDK-level success/failure info

šŸ’» Platform Usage

React Native
rdnaEventRegistery.addListener('onAuthenticationOptionsAvailable', (event) => {
  console.log(event.authenticationOptions);
  // App should render the UI for options
});
Flutter
rdna.on(RdnaClient.onAuthenticationOptionsAvailable, (options) {
  print("Options: $options");
});
Cordova
document.addEventListener('onAuthenticationOptionsAvailable', function(e) {
  console.log(e.authenticationOptions);
});

āœ… Developer Action

  • The app will call the authenticateUsing API to initiate authentication by passing one of the options from the authenticationOptions available in the payload.


šŸ” REL-ID SDK API: authenticateUsing

🧭 Overview

The authenticateUsing API is used to initiate user authentication with a specific method (e.g., Password, Local Device Authentication) selected from the options provided by the SDK via onAuthenticationOptionsAvailable.


šŸ“Œ Purpose

  • Authenticate a user using a method like LDA, Face ID, Pattern, or Password.
  • Complete login or trigger challenge-based verification flow.

šŸ•’ When to Use

  • After receiving the onAuthenticationOptionsAvailable event.
  • Once the user chooses an authentication method (e.g., Password, DEVICE_LDA).
  • Before continuing to next steps like session setup or secure access.

🧾 Parameters

ParameterTypeDescription
selectedAuthenticationOptionStringAuthentication method chosen (e.g., "PASSWORD", "DEVICE_LDA")
challengeModeEnumChallenge operation mode (e.g., AUTO, SEMIAUTO) as RDNAChallengeOpMode

šŸ’” Example Usage

React Native
RdnaClient.authenticateUsing("PASSWORD", "AUTO", (syncResponse) => {
  console.log("Auth response:", syncResponse);
});
Flutter
await rdnaClient.authenticateUsing("DEVICE_LDA", RDNAChallengeOpMode.AUTO);
Cordova
com.uniken.rdnaplugin.RdnaClient.authenticateUsing(
  successCallback,
  errorCallback,
  ["PASSWORD", "AUTO"]
);
Native iOS
[client authenticateUsing:@"DEVICE_LDA" challengeMode:RDNAChallengeOpModeAuto];
Native Android
RDNAError result = rdnaClient.authenticateUsing("PASSWORD", RDNAChallengeOpMode.AUTO);

āš ļø Error Codes

Code

Error Enum

Description

413

RDNA_ERR_AUTHENTICATION_OPTION_CHO

SEN_NOT_SUPPORTED

SDK API AuthenticateUsing will return this error code (in sync) if the provided authenticator string is invalid and

does not match any of the strings provided in the callback ā€œonAuthenticationOptionsAvailableā€œ.


āœ… On Success

  • Authentication proceeds and session is established.
  • SDK may emit session-related events or continue login flow.

āŒ On Failure

  • App should fallback to password or allow retry.