Login via OTP Code Device Pairing

The Passwordless Login with OTP Code Device Pairing feature allows users to securely authenticate without a password by pairing a new device with an already authenticated device. This mechanism supports bidirectional pairing:

  1. From a logged-in device to a new device

  2. From a new device to a logged-in device

Key benefits:

  • Strong security using short-lived OTP codes.

  • Seamless user experience with minimal interaction.

  • Device management through X-Device-* headers for device metadata.

Flow 1 – Logged-in Device Initiates Pairing

This flow is initiated from a logged-in device (Device A) to authorize a new device (Device B).

Sequence Diagram

Step-by-Step Description

  1. Generate OTP Code from Device A

  2. Display OTP Code to Device B

    • Device B input the OTP code.

  3. Device A approves pairing

  4. Device B polls pairing status

  5. Device B logs in

Flow 2 – New Device Initiates Pairing

This flow allows a new device (Device B) to initiate pairing, which is approved by the logged-in device (Device A).

Sequence Diagram

Step-by-Step Description

  1. Device B generates OTP Code

  2. Device B polls OTP code status

  3. Device A approves pairing

  4. Device B completes login

📔 Notes: If the client includes the X-Device-Token header during OTP code generation, the server will send a push notification (data message) to that device after the OTP is approved.

Push Notification Payload Example:

Security Considerations

  • OTP codes are single-use and time-limited to prevent replay attacks.

  • Auth-Key ensures device-level authorization for approval actions.

  • Tokens (authKey & refreshKey) are issued only after pairing confirmation.

  • Device metadata headers (X-Device-*) are required to register the device securely.


Summary

The OTP code-based passwordless login mechanism enables secure, bidirectional device pairing. Users can:

  • Authorize new devices from a logged-in device.

  • Initiate pairing from a new device and have it approved by an existing device.

This system ensures security, ease of use, and full device traceability.

Last updated