Zalo Login Via QR Code icon

Zalo Login Via QR Code

LĐăng nhập Zalo bằng QR code và lưu thông tin vào Credentia

Overview

This node facilitates logging into the Zalo messaging platform using a QR code. It generates a QR code that users scan with their Zalo app to authenticate and obtain login credentials. The node supports using existing Zalo API credentials or an n8n account credential to streamline the login process. After successful login, it can automatically save new credentials for future use.

Common scenarios where this node is beneficial include:

  • Automating Zalo login in workflows without manual password entry.
  • Integrating Zalo messaging capabilities into n8n workflows by obtaining valid session credentials.
  • Managing multiple Zalo accounts by generating and storing credentials programmatically.

Practical example:

  • A user wants to send automated messages via Zalo after authenticating. This node generates a QR code for login, waits for the user to scan it, then saves the credentials for subsequent API calls.

Properties

Name Meaning
Proxy HTTP proxy URL (e.g., https://user:pass@host:port) to route Zalo API requests through.

Output

The node outputs a JSON object and binary data representing the generated QR code image:

  • json:

    • success: Boolean indicating if the QR code was generated successfully.
    • message: Informational message about the login status or credential usage.
    • fileName: The filename of the QR code image (zalo-qr-code.png).
    • usingExistingCredential: Boolean indicating if existing credentials were used.
    • credentialInstructions: Instructions related to credential usage or creation.
    • credentialName, credentialId, credentialType: Metadata about the credentials used (if any).
    • credentialFilePath: Path to saved credentials file if credentials are saved locally.
    • autoCreateScript: Script name for manual credential creation fallback.
    • autoCreateApi: Indicates if credentials will be created automatically via n8n API.
  • binary:

    • data: The QR code image in PNG format encoded as binary data, ready for display or download.

Dependencies

  • Requires access to the Zalo SDK library for handling login and QR code generation.
  • Optionally requires credentials for:
    • An API key credential to connect with Zalo API.
    • An n8n account credential for automating credential creation via n8n API.
  • Supports configuring an HTTP proxy for network requests.
  • Uses Axios for HTTP requests when creating credentials via n8n API.
  • Requires write access to the local filesystem if saving credentials to a file.

Troubleshooting

  • Timeout generating QR code: If the QR code generation times out (default 30 seconds), check network connectivity and proxy settings.
  • No credentials provided: The node can generate a QR code without credentials but cannot automate login without scanning the QR code manually.
  • Credential creation errors: Errors during automatic credential creation via n8n API may require manual intervention using the provided script.
  • QR code expired: If the QR code expires before scanning, rerun the node to generate a new one.
  • Proxy issues: Incorrect proxy configuration may prevent successful connection to Zalo services.
  • SDK connection errors: Network or authentication issues may cause the Zalo SDK to fail connecting; verify credentials and network access.

Links and References

Discussion