Authing DocsDocuments
Concept
workflow
Guides
Development Integration
Application integration
Concept
workflow
Guides
Development Integration
Application integration
Old Version
Development Integration
  • Single Sign-On (SSO)
  • Login component

  • JavaScript/Node.js

  • Java / Kotlin

  • Python

  • C#

  • PHP

  • Go

  • Ruby
  • Android

  • iOS

    • Quick start
    • Auth Flow
    • APIs

      • Authentication
      • OIDC
      • MFA
      • User management
      • Scan to login
    • Third-party identity source

    • Typical scene

    • On-premise
    • WebAuthn
    • Error Code List
  • Flutter

  • React Native
  • WeChat Mini Program
  • WeChat webpage authorization
  • Framework Integration
  • Error code
  1. Development Integration
  2. /
  3. iOS
  4. /
  5. APIs
  6. /
  7. Scan to login

¶ Scan API

Update Time: 2026-03-25 09:13:34
Edit

To use scan to login functionality, please check 'APP QR Code' at our console.

When web application needs to authenticate user, a QR code will be popped up:

The QR code has the following data structure:

{
    "scene": "APP_AUTH",
    "random": "5e05f0c57fde537d950f7da5",
    "userPoolId": "5e04ae0d5f3cee22fb37612b",
    "createdAt": "2019-12-27T11:53:41.260Z",
    "expireAt": "2019-12-27T11:55:41.260Z"
}

In your mobile App, first make sure user is already logged in, then call following API when scan to login is requried:

¶ Mark QR code

When this API succeed, the web login page will show user picture on top of the QR code

public static void markQRCodeScanned(String ticket, @NotNull AuthCallback<JSONObject> callback)

param

  • ticket the random field in the QR code data

example

AuthClient().markQRCodeScanned(random, (code, message, data) -> {
    if (code == 200) {
        // notify user to authorize
    }
});

error

  • 500 invalid QR code
  • 2020 not logged

¶ Confirm log in by QR code

This API do the actual login. The reason we split it into two steps is that right after scanning and marking, the mobile app can show a dialog, asking user to confirm the authentication.

Note: Before calling this API, you must first call Mark QR code

public static void loginByScannedTicket(String ticket, @NotNull AuthCallback<JSONObject> callback)

param

  • ticket the random field in the QR code data

example

AuthClient().loginByScannedTicket(random, (code, message, data) -> {
    if (code == 200) {
        // logged in
    }
});

error

  • 500 invalid QR code
  • 2020 not logged

Prev: User management Next: Third-party identity source
  • Mark QR code
  • Confirm log in by QR code

User identity management

Integrated third-party login
Mobile phone number flash check (opens new window)
Universal login form component
Custom authentication process

Enterprise internal management

Single Sign On
Multi-factor Authentication
Authority Management

Developers

Development Document
Framework Integration
Blog (opens new window)
GitHub (opens new window)
Community User Center (opens new window)

Company

400 888 2106
sales@authing.cn
16 / F, Block B, NORTH STAR CENTURY CENTER, Beijing(Total)
room 406, 4th floor, zone B, building 1, No. 200, Tianfu Fifth Street, Chengdu(branch)

Beijing ICP No.19051205-1

© Beijing Steamory Technology Co.