onSelectSecretQuestionAnswer

Setting the Secret Question and Answer

🔐onSelectSecretQuestionAnswer Event

The onSelectSecretQuestionAnswer event is triggered by the REL-ID SDK during first-time activation or registration. It prompts the application to ask the user to choose a secret question from a predefined list and provide an answer. This information is used for identity verification in future authentication scenarios.


📋 Purpose

This event facilitates setting up fallback authentication by allowing users to select and answer secret questions. The SDK expects the application to collect this information and call the corresponding API to submit it. The secret questions and how many questions user should answer will be configured in the Gateway Manager by REL-ID Admin.


📥 Sample Payload

Click to expand the sample payload
{
  "userID": "testuser",
  "challengeResponse": {
    "status": {
      "statusCode": 100,
      "statusMessage": ""
    },
    "session": {
      "sessionType": 0,
      "sessionID": "SESSION_ID_STRING"
    },
    "additionalInfo": {
      "DNAProxyPort": 0,
      "isAdUser": 0,
      "isDNAProxyLocalHostOnly": 0,
      "JWT": "",
      "accessTokenInfo": "",
      "settings": "",
      "configSettings": "",
      "loginIDs": [],
      "currentWorkFlow": "FirstTimeUserActivation"
    },
    "challengeInfo": [
      { "key": "Prompt label", "value": "Secret Question" },
      { "key": "Response label", "value": "Secret Answer" },
      { "key": "Description", "value": "Choose your secret question and then provide answer" },
      { "key": "Reading", "value": "Set secret question and answer" }
    ]
  },
  "questionsToSet": [
    [
      "What is your nickname?",
      "What is the name of your mother?",
      "What is the name of your father?",
      "What is the name of your sister?",
      "What is the name of your brother?"
    ]
  ],
  "challengeMode": 1,
  "numberOfQuestionsToSet": 1,
  "error": {
    "longErrorCode": 0,
    "shortErrorCode": 0,
    "errorString": "Success"
  }
}

🧾 Field Descriptions

FieldDescription
userIDUnique identifier for the user undergoing activation.
challengeResponse.statusCodeNumeric code indicating the result of the current operation (e.g. 100 = Success).
challengeResponse.statusMessageDescriptive status message (may be empty on success).
session.sessionTypeInteger representing the session type (0 = App session).
session.sessionIDUnique session identifier.
additionalInfo.currentWorkFlowIndicates the current operation (e.g., FirstTimeUserActivation).
challengeInfoList of key/value instructions for displaying UI.
questionsToSetA nested array of strings containing the available secret questions.
challengeModeChallenge display mode; typically handled by the app (value = 1).
numberOfQuestionsToSetNumber of questions the user must set (typically 1).
error.errorStringDescriptive error message (e.g., “Success”).

💬 Developer Responsibilities

As a developer, you must:

  1. Display the questions from questionsToSet to the user.
  2. Prompt the user to select one and provide an answer.
  3. Call setSelectSecretQuestionAnswer(question, answer) to submit the input.