¶ List of complete interfaces for APP code scanning login
GenAuth provides a REST-based code scanning login interface that developers can call directly.
¶ Generate QR code
This interface will return the QR code ID (random) and QR code link.
Generated QR code example:

使用在线二维码解码工具 (opens new window) 查看二维码数据如下:
{
"scene": "APP_AUTH",
"random": "SzZrszCJNCFfVBDUCKLDtAYNBR96SK",
"userPoolId": "5fae2648201cfd526f0ec354",
"createdAt": "2020-11-13T06:23:25.396Z",
"expiresIn": 120,
"customData": {}
}
¶ Query QR code status
Request result field description:
- status
- 0: Not scanned.
- 1: Scanned but the user has not clicked to agree to authorization or cancel authorization. At this time, the user's avatar and nickname will be returned, but no other confidential information will be included. It can be used for front-end avatar display.
- 2: User agrees to authorization
- 3: User cancels authorization
- -1: Expired
- userInfo:
- By default, after the user scans the code, the nickname and avatar fields will be included
- Developers can also configure the return of complete user information (including login credentials token)
- ticket: used to exchange for complete user information. **This field will only appear after the user agrees to authorization. **See below for details.
¶ Use ticket to exchange for user information
Note: By default, this interface is only allowed to be called on the server side, that is, after initialization with the user pool key.
The default validity period of the ticket is 300 seconds.
Developers can modify it in the GenAuth console (opens new window) Basic Configuration -> Basic Settings -> App Scan Code Login Web Custom Configuration. **For details, see Custom Configuration Item Page. **
¶ APP-side mark scanned code
The APP side marks that the code has been scanned. After marking the code scanned, the web side will be able to obtain the nickname and avatar of the current user.
The APP needs to meet two conditions:
- The user must be logged in
- The user's user pool ID matches the QR code user pool ID.
¶ APP side agrees to authorization
APP side agrees to authorization. Before calling this interface, you need to call the scanned interface first.
The APP needs to meet two conditions:
- The user must be logged in
- The user's user pool ID matches the QR code user pool ID.
¶ Cancel authorization on the APP
App end cancels authorization. Before calling this interface, you need to call the scanned interface first.
The APP needs to meet two conditions:
- The user must be logged in
- The user's user pool ID matches the QR code user pool ID.
