Registering for TOTP

šŸ”„ Automatic TOTP Registration Flow

āœ… When Does It Happen?

  • Immediately after successful login, the Ditto ID SDK automatically checks and attempts to register the user for TOTP.
  • This process is automatic—the application does not need to manually invoke any API.

🧠 What the SDK Does

  1. Detects that login has succeeded.
  2. Checks if:
    • TOTP is supported for the user.
    • The user is not already registered for TOTP on the current device.
  3. If registration is needed:
    • SDK attempts to register the user silently in the background.

šŸ“© Event: onTOTPRegistrationStatus

After attempting to register for TOTP, the SDK emits the onTOTPRegistrationStatus event to notify the application about the outcome.


šŸ§‘ā€šŸ’» Developer Guidance

  • āœ… If successful: No additional action is needed. User is now ready to generate TOTP.
  • āŒ If failed:
    • Log the error or show feedback to the user.
    • Retry registration later or prompt user manually if TOTP is required.

This registration step ensures that TOTP functionality is set up seamlessly for secure authentication and offline scenarios.


Did this page help you?