Login via QR Code Device Pairing

The Passwordless Login with QR 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 QR codes and device-specific authorization tokens.

  • 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 QR Code from Device A

  2. Display QR Code to Device B

    • Device B scans the QR code locally.

    • The QR code encodes the pairing QR code ID.

  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 QR Code

  2. Device B polls QR code status

  3. Device A approves pairing

  4. Device B completes login

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

Push Notification Payload Example:

Security Considerations

  • QR 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 QR 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