getAllChallenges

🚀 getAllChallenges API

📘 Overview

The getAllChallenges API in REL-ID SDK is designed to fetch all authentication challenges available for updating user credentials. It plays a crucial role in maintaining the security and integrity of user authentication flows by proactively managing credential updates.

The combination of getAllChallenges and the onCredentialsAvailableForUpdate event enables mobile applications to dynamically present and manage credential update options for users, thus offering a seamless and secure user experience.


🎯 Purpose

  • 🛡 Retrieve authentication challenges for updating credentials.
  • 🔐 Allow proactive or reactive credential updates to ensure ongoing account security.
  • 📱 Enable applications to present relevant update options to users.

📱 UI Guidelines

The mobile app developer must present users with a screen displaying all available authentication challenges, such as Password, Pattern, or Security Questions. Users can select from these to initiate credential updates.


⚙️ API Flow Step-by-Step

  1. API Call: Invoke getAllChallenges with the user's unique ID.
  2. SDK Response: Triggers onCredentialsAvailableForUpdate` event.
  3. Developer Action: Present received options to the user for credential updates.
  4. User Action: User selects the desired credential type.
  5. Follow-up API Call: Developer invokes initiateUpdateFlowForCredential with the selected credential type.
  6. Credential Update: Complete the specific update flow (e.g., password or security question update).

📥 Payload Fields

FieldTypeDescription
userIDStringUnique ID of the user

Return type

React Native, Flutter, Native Android : Error/Success Response

{
  "error": {
    "longErrorCode": 0,
    "shortErrorCode": 0,
    "errorString": "Success"
  }
}

Native iOS - RDNAError

{
   "longErrorCode": <INTEGER LONG ERROR CODE>,
   "errorCode": <This enum (RDNAErrorID) specifies all the error codes which RDNA returns back to the client.>,
   "errorString": "<ERROR MESSAGE>"
}

💬 Sample Code by Platform

React Native
RdnaClient.getAllChallenges(userID, (syncResponse) => {
  console.log(syncResponse);
});
Flutter
rdnaClient.getAllChallenges(userID);
Cordova
com.uniken.rdnaplugin.RdnaClient.getAllChallenges(
  successCallback,
  errorCallback,
  [userID]
);
Native Android
rdnaClient.getAllChallenges(userID, (syncResponse) => {});
Native iOS (Objective-C)
[rdnaInstance getAllChallenges:userID];