Login
š Ditto ID Login Process (Activated User ā Same Device)
This document outlines the normal login flow in the Ditto ID SDK for an activated user on the same device, using either password or Local Device Authentication (LDA), with key SDK events integrated.
ā
Prerequisites
Before initiating the login flow, the following conditions must be met:
- The user must already be activated on the current device.
- The app must have already called the SDK's initialization routine.
- A valid Ditto ID connection profile must be available (e.g.,
Agent_info.txt). - The SDK should not be in a reset, terminated, or uninitialized state.
- Device must not be blocked or exceed authentication retry limits.
š§ Login Workflow with SDK Events
flowchart TD
A[Start: User opens App] --> initialise[App initialization]
initialise --> getUser[SDK triggers getUser]
getUser --> setUser[App calls setUser]
setUser --> auth1{Is both password and LDA present for the user?}
auth1 -- Yes --> authChoice{Allow user Authentication Choice?}
authChoice -- Yes --> onAuthenticationOptionsAvailable[SDK triggers onAuthenticationOptionsAvailable]
onAuthenticationOptionsAvailable --> authenticateUsing[App calls authenticateUsing]
authenticateUsing -- LDA --> lda1[SDK shows LDA prompt]
lda1 --> lda2[User provides LDA]
onUserLoggedIn[SDK triggers onUserLoggedIn]
authenticateUsing -- Password --> password[SDK triggers getPassword]
password --> passwordScreen[App shows password screen, calls setPassword]
selfieBiometricTemplateChallengePresent{SelfieBiometricTemplate Challenge?}
getIDVSelfieProcessStartConfirmation[SDK triggers getIDVSelfieProcessStartConfirmation]
setIDVSelfieProcessStartConfirmation[App calls setIDVSelfieProcessStartConfirmation]
initiateSelfieCapture[SDK initiates selfie capture]
passwordScreen --> selfieBiometricTemplateChallengePresent
lda2 --> selfieBiometricTemplateChallengePresent
selfieBiometricTemplateChallengePresent -- No --> onUserLoggedIn
selfieBiometricTemplateChallengePresent -- Yes --> getIDVSelfieProcessStartConfirmation
getIDVSelfieProcessStartConfirmation --> setIDVSelfieProcessStartConfirmation
setIDVSelfieProcessStartConfirmation --> initiateSelfieCapture
initiateSelfieCapture --> onUserLoggedIn
onUserLoggedIn --> loginEnd[End login flow]
auth1 -- No --> isLDAAvailable{Is LDA available}
isLDAAvailable -- Yes --> lda1
isLDAAvailable -- No --> password
authChoice -- No --> isLDAAvailable
style getUser fill:#d4fdd4,stroke:#228b22,stroke-width:2px
style onAuthenticationOptionsAvailable fill:#d4fdd4,stroke:#228b22,stroke-width:2px
style onUserLoggedIn fill:#d4fdd4,stroke:#228b22,stroke-width:2px
style password fill:#d4fdd4,stroke:#228b22,stroke-width:2px
style selfieBiometricTemplateChallengePresent fill:#d4fdd4,stroke:#228b22,stroke-width:2px
style initialise fill:#ffe4b3,stroke:#ff8c00,stroke-width:2px
style setUser fill:#ffe4b3,stroke:#ff8c00,stroke-width:2px
style authenticateUsing fill:#ffe4b3,stroke:#ff8c00,stroke-width:2px
style passwordScreen fill:#ffe4b3,stroke:#ff8c00,stroke-width:2px
style getIDVSelfieProcessStartConfirmation fill:#ffe4b3,stroke:#ff8c00,stroke-width:2px
š© Green - Callbacks issued by Ditto ID SDK
š§ Orange - APIs invoked by the Client App
š Explanation of Login Workflow
-
User Opens the App
The app launches and internally prepares to perform user login. -
App Initialization
The SDK is initialized using theinitialize()call, setting up secure communication and environment. -
SDK Triggers
getUser
This event is invoked by the SDK node module to instruct the API client that the Ditto ID SDK needs the username as a response to proceed further. The application can either auto-submit the username or display a screen for the user to input it. -
App Calls
setUser
The app submits the user ID to the SDK using thesetUser()method. This prepares the SDK to proceed with determining available authentication options and executing the login flow. -
Determine Auth Options
The SDK checks if the user has both password and LDA configured. -
Case: Both Password and LDA Present
- If user policies allow, the SDK emits
onAuthenticationOptionsAvailable, letting the app present a UI for the user to choose. - Based on the choice:
- For LDA: The SDK shows the biometric prompt, and upon success, emits
onUserLoggedIn. - For Password: The SDK triggers
getPassword. The app shows a password input screen and callssetPassword(). On success, SDK emitsonUserLoggedIn.
- For LDA: The SDK shows the biometric prompt, and upon success, emits
- If user policies allow, the SDK emits
-
Case: Only One Auth Method Present
- If only LDA is available: SDK shows LDA prompt.
- If only Password is available: SDK triggers password input flow.
-
Authentication Completion
Once the correct credentials are verified, the SDK emitsonUserLoggedInto confirm successful login.
Updated 4 months ago
