Skip to main content

Forgot Password

Once the account has been activated, users can utilize the Forgot Password feature to create a new password by entering their user ID, activation code, and new password. The activation code can be obtained using the Postman Collection API. Refer to How to get activation code.

KSSIDP Forgot Password Flow Diagram for KOBIL Shift Lite

The event flow diagram illustrates the sequence of events during the forgot password process for KOBIL Shift Lite - KSSIDP.

Implementation Examples

Swift/iOS

The KssIdpForgotPassword function acts as the bridge between the user interface and the identity provider. This function utilizes the forgotPin method from kssIdpWrapper to trigger the forgot pin process, with the result being handled by the handleResult function.

Triggering KssIdpForgotPassword (Swift/iOS)
func KssIdpForgotPassword(
clientId: String,
credentials: [String: String]) {

self.kssIdpWrapper.forgotPin(
clientId: clientId,
credentials: credentials
) { resultObject, _ in
handleResult(resultObject: resultObject)
}
}

Android/Kotlin

This function utilizes the forgotPin method from KssIdp Instance to trigger the forgot password process, with the result being handled by the onResultReceived listener.

Triggering KssIdpForgotPassword (Android/Kotlin)
fun triggerKssIdpForgotPassword(
clientId: String,
credentials: HashMap<String, String>,
onResultReceived: ((result: ResultObject) -> Unit)? = onResultReceivedCallback
) {
launchIO {
KssIdp.getInstance()?.forgotPin(clientId, credentials, onResultReceived)?.then {
// handle result
}
}
}

Flutter/Dart

The Flutter implementation uses the KssIdpApi to trigger the forgot password process. This function handles user credentials including the activation code and new password, processing the result through the IDP flow.

Triggering KssIdpForgotPassword (Flutter/Dart)
Future<void> performKssForgotPassword(
String username,
String activationCode,
String newPassword) async {
try {
// Create credentials map with activation code and new password
final credentials = {
'username': username,
'activation-code': activationCode,
'new-password': newPassword,
};

// Get your KssIdpApi instance
final kssIdpHelper = locator<KssIdpHelper>();

// Perform the forgot password request
final forgotPasswordResult = await kssIdpHelper.idpApi.forgotPassword(
'your-client-id',
credentials,
);

// Handle the forgot password result
switch (forgotPasswordResult.status.runtimeType) {
case KssIdpStatusSuccess:
print("✅ Password reset successful");
break;

case KssIdpStatusRequestFailed:
final error = (forgotPasswordResult.status as KssIdpStatusRequestFailed).errorDescription;
print("❌ Password reset request failed: $error");
break;

case KssIdpStatusEventFailed:
final error = (forgotPasswordResult.status as KssIdpStatusEventFailed).errorDescription;
print("❌ Password reset event failed: $error");
break;

default:
print("❓ Unknown password reset result status");
}

} catch (e) {
print("❌ Password reset exception: $e");
// Handle exception
}
}

For an example that uses Flutter Redux for state management, you can view our provided demo app.

Request Parameters

The following parameters are used in KSSIDP Forgot Password:

clientId: This value is provided by the KOBIL IDP services.
credentials: {
"username": VALUE-TO-PASS,
"activation-code": VALUE-TO-PASS,
"new-password": VALUE-TO-PASS
}

Important Notes

For more information about MC usage during KSSIDP flows, please refer to the CreateHttpCommonRequest and SetAuthorisationCode events.

Response Handling

In response to a ForgotPin Event, KSSIDP sends a KssIdpResultObject with the appropriate status.