Activation
Before proceeding with activation, users must obtain an activation code using a Postman collection integrated with API calls designed to retrieve the code. Refer to the User Activities API documentation for step-by-step instructions on generating this activation code.
When a StartResultEvent with ACTIVATION_REQUIRED as sdkState is received in response to the StartEvent, users should initiate the Activation flow.
This involves triggering the KSSIDP activate to provide the username, activation code, and desired password to the IDP. It is crucial to strictly follow the specified flows in the correct sequence for a seamless and successful activation process.
KSSIDP Activation Flow Diagram for KOBIL Shift Lite
The event flow diagram illustrates the sequence of events during the activation process for KOBIL Shift Lite - KSSIDP.
Implementation Examples
Swift/iOS
The KssIdpActivation
function acts as the bridge between the user interface and the identity provider. This function utilizes the activate method from KssIdpWrapper to trigger the activation process, with the result being handled by the handleResult function.
func KssIdpActivation(
clientId: String,
authMode: KSMAuthenticationMode,
credentials: [String: String]) {
self.kssIdpWrapper.activate(
clientId: clientId,
credentials: credentials,
authMode: authMode
) { resultObject, _ in
handleResult(resultObject: resultObject)
}
}
Android/Kotlin
This function utilizes the activate method from KssIdp Instance to trigger the activation process, with the result being handled by the onResultReceived listener.
fun KssIdpActivation(
clientId: String,
authMode: AuthenticationMode,
credentials: HashMap<String, String>,
onResultReceived: ((result: ResultObject) -> Unit)? = onResultReceivedCallback
) {
launchIO {
KssIdp.getInstance()?.activate(clientId, authMode, credentials, onResultReceived)?.then {
// handle result
}
}
}
Flutter/Dart
In Flutter you can use the KssIdpApi to trigger the activation process. This function handles user credentials including the activation code and processes the activation result through the IDP flow.
Future<void> performKssActivation(
String username,
String activationCode,
String password) async {
try {
// Create credentials map with activation code
final credentials = {
'username': username,
'password': password,
'activation-code': activationCode,
};
// Get your KssIdpApi instance
final kssIdpHelper = locator<KssIdpHelper>();
// Perform the activation
final activationResult = await kssIdpHelper.idpApi.activate(
'your-client-id',
AuthenticationMode.no, // Or your preferred auth mode
credentials,
);
// Handle the activation result
switch (activationResult.status.runtimeType) {
case KssIdpStatusSuccess:
print("✅ Activation successful");
break;
case KssIdpStatusRequestFailed:
final error = (activationResult.status as KssIdpStatusRequestFailed).errorDescription;
print("❌ Activation request failed: $error");
break;
case KssIdpStatusEventFailed:
final error = (activationResult.status as KssIdpStatusEventFailed).errorDescription;
print("❌ Activation event failed: $error");
break;
default:
print("❓ Unknown activation result status");
}
} catch (e) {
print("❌ Activation exception: $e");
// Handle exception
}
}
For an example that is using Flutter Redux for state management, you can view our provided demo app.
Request Parameters
The following parameters are used in KSSIDP Activation:
clientId: This value is provided by the KOBIL IDP services.
credentials: {
"username": VALUE-TO-PASS,
"password": VALUE-TO-PASS,
"activation-code": VALUE-TO-PASS
}
Important Notes
INFO: In the KOBIL Shift Lite environment, you can choose between several authentication modes during the KSSIDP Activation.
For more information about MC usage during KSSIDP flows, please refer to the CreateHttpCommonRequest and SetAuthorisationCode events.
Response Handling
In response to an ActivateEvent, KSSIDP sends a SetAuthorisationCodeResultEvent with the appropriate status.