Qingpu Device Tokens

Qingpu device tokens authenticate the browser extension and desktop app when an APay HTTP-only cookie is unavailable. They identify the user for theme API requests; they do not represent a subscription, trial, product, order, tenant, or capability.

Contract

  • Tokens use the qpd_ prefix and only their SHA-256 hash is stored in qingpu_device_tokens.
  • Each user can have at most one active token. A new extension or desktop login revokes the previous token with reason new-device-login.
  • Tokens expire after 90 days as a login-security measure. This date is not a membership expiry date.
  • Website cookie sessions are independent and are not subject to the single-device restriction.
  • Product access is resolved through /api/qingpu/user-capabilities; issuing or revoking a device token does not change capabilities.

Endpoints

  • POST /api/qingpu/login and POST /api/qingpu/register return deviceToken metadata and the one-time rawToken.
  • POST /api/qingpu/device-tokens/verify verifies the Bearer token.
  • GET /api/qingpu/device-tokens and POST /api/qingpu/device-tokens/revoke require a website cookie session and let users inspect or revoke login devices.

When another device logs in, the old client receives 401 Unauthorized on its next authenticated request and must return to the login screen.