GenAuth DocsDocuments
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
Development Integration
  • API

  • SDK

    • Java

    • Node.js

    • Python

      • Installation and Usage
      • Authentication Module

        • Login

          • Login with Account Password
          • Login with Username Password
          • Login with Phone Password
          • Login with Email Password
          • Login with Email Passcode
          • Login with Phone Passcode
          • Login with LDAP Account
          • Login with AD Account
          • Login with User Credentials
          • Login with Mobile Social Login
          • Get Alipay AuthInfo
          • Generate QR Code for Login
          • Check QR Code Status
          • Exchange TokenSet with QR Code Ticket
          • Custom APP QR Code Login: Change QR Code Status on APP Side
        • Logout

        • Register

        • User Profile

        • Account Binding

        • MFA Factor Management

        • User Related Resources

        • Message Service

        • WeChat Related APIs

        • Others

        • OIDC Module
        • OAuth Module
        • SAML Module
        • CAS Module
        • Events
      • Management Module

  • Error Codes
  1. Development Integration
  2. /
  3. SDK
  4. /
  5. Python
  6. /
  7. Authentication Module

  8. /
  9. Login

  10. /
  11. Generate QR Code for Login

¶ Generate a QR code for login

Update time: 2025-07-23 07:34:21
Edit

This document is automatically generated based on https://github.com/authing/authing-docs-factory based on https://api-explorer.genauth.ai V3 API, and is consistent with API parameters and return results. If the description of this document is incorrect, please refer to V3 API.

Generate a QR code for login. Currently, it supports the generation of QR codes for WeChat public account scan code login, mini program scan code login, and self-built mobile APP scan code login.

¶ Method name

AuthenticationClient.gene_qr_code

¶ Request parameters

NameType
Required
Default value
Description
Sample value
typestringYes-QR code type. Currently supports three types:
- MOBILE_APP: Scan the QR code with a self-built mobile APP
- WECHAT_MINIPROGRAM: Scan the QR code with a WeChat applet
- WECHAT_OFFICIAL_ACCOUNT Scan the QR code with a WeChat public account
MOBILE_APP
extIdpConnIdstringNo-When type is WECHAT_MINIPROGRAM or WECHAT_OFFICIAL_ACCOUNT, you can specify the identity source connection, otherwise the first corresponding identity source connection opened by the application is used by default to generate the QR code.62eb7ed1f04xxxxc6955b329
customDataobjectNo-When type is MOBILE_APP, you can pass the user's custom data. When the user successfully scans the QR code for authorization, this data will be stored in the user's custom data.{"school":"hust"}
contextobjectNo-When type is WECHAT_OFFICIAL_ACCOUNT or WECHAT_MINIPROGRAM, specify a custom pipeline context, which will be passed in the pipeline context{"source":"utm"}
autoMergeQrCodebooleanNo-When type is WECHAT_MINIPROGRAM, whether to automatically merge the custom logo into the generated image, the default value is false. The process of merging QR codes on the server will increase the interface response speed. It is recommended to use the default value and stitch the images on the client. If you use the GenAuth SDK, you can save the manual stitching process.

¶ Request response

Type: GeneQRCodeRespDto

NameTypeDescription
statusCodenumberBusiness status code, which can be used to determine whether the operation is successful. 200 means success.
messagestringDescription
apiCodenumberSegmented error code, which can be used to get the specific error type (successful request does not return). For a detailed list of error codes, please see: API Code List (opens new window)
requestIdstringRequest ID. Returned when the request fails.
dataGeneQRCodeDataDtoResponse data

Example result:

{
  "statusCode": 200,
  "message": "Success",
  "requestId": "934108e5-9fbf-4d24-8da1-c330328abd6c",
  "data": {
    "qrcodeId": "gQE-8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyMGJjX",
    "url": "https://files.authing.co/user-contentsqrcode/59f86b4832eb28071bdd9214/gQE-8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyMGJjX1ZhOFNiM1UxV29GVTF5MWMAAgQY4_RiAwSAxhMA.png",
    "customLogoUrl": "https://files.authing.co/authing-console/social-connections/wechatMiniLogin.svg"
  }
}

¶ Data structure

¶ GeneQRCodeDataDto

NameType
Is it required?
Description
Sample value
qrcodeIdstringYesThe unique ID of the QR code. The QR code status can be queried through this unique ID.gQE-8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyMGJjX
urlstringYesThe QR code URL. The front end can render the QR code based on this link.https://files.authing.co/user-contentsqrcode/59f86b4832eb28071bdd9214/gQE-8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyMGJjX1ZhOFNiM1UxV29GVTF5MWMAAgQY4_RiAwSAxhMA.png
customLogoUrlstringNoIf the mini program scan code login is used and the request parameter autoMergeQrCode is set to false, the configured custom logo will be returned, and the front end can stitch this logo onto the QR code URL by itself.https://files.authing.co/authing-console/social-connections/wechatMiniLogin.svg
Previous article: Get Alipay AuthInfo Next article: Check QR Code Status
  • Method name
  • Request parameters
  • Request response
  • Data structure

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.