Skip to main content

Login

When a StartResultEvent with LOGIN_REQUIRED as sdkState is received in response to the StartEvent, users should initiate the Login flow.

This involves triggering the KSSIDP login to provide the username, and created password to the IDP. It is crucial to strictly follow the specified flows in the correct sequence for a seamless and successful login process.

KSSIDP Login flow diagram for KOBIL Shift Lite

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

For integrating the login flow you will need to follow the below steps. Here they are shown with the file names and are just for reference and ease, you can change the way of integration but you must follow the same sequence to achieve the correct result.

Swift/iOS

KssIdpLogin function, acts as the bridge between the user interface and the identity provider. This function utilizes the login method from kssIdpWrapper to trigger the login user process, with the result being handled by the handleResult function.

Triggering KssIdpLogin (Swift/iOS)
 
func KssIdpLogin(
clientId: String,
authMode: KSMAuthenticationMode,
credentials: [String: String]) {

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

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

Android/Kotlin

Triggering KssIdpLogin (Android/Kotlin)

fun triggerKssIdpLogin(
clientId: String,
authMode: AuthenticationMode,
credentials : HashMap<String, String>,
onResultReceived: ((result: ResultObject) -> Unit)? = onResultReceivedCallback
) {
launchIO {
KssIdp.getInstance()?.login(clientId, authMode, credentials, onResultReceived)?.then {
// handle result
}
}
}

Request params

Parameters which are used in KSSIDP Login are explained below:

clientId: This value would be provided by the KOBIL IDP services.
credentials: {
"username": VALUE-TO-PASS,
"password": VALUE-TO-PASS
}


INFO: Note that in the KOBIL Shift Lite environment, you can choose between several authentication modes during the KSSIDP Login User implementation.

To get more info about MC usage during the KSSIDP flows, please check the CreateHttpCommonRequest and SetAuthorisationCode events.


All Platforms

As response to LoginEvent, KSSIDP sends a SetAuthorisationCodeResultEvent with appropriate status.