Back to Lobehub

Configuring WeChat Authentication for LobeHub

docs/self-hosting/auth/providers/wechat.mdx

2.1.562.4 KB
Original Source

Configuring WeChat Authentication

WeChat Open Platform enables third-party applications to integrate WeChat login.

<Callout type={'warning'}> WeChat Web Login requires a verified WeChat Open Platform account and an approved website application. This process requires business verification in China. </Callout>

<Steps> ### Create Website Application on WeChat Open Platform
  1. Go to WeChat Open Platform
  2. Register and verify your developer account
  3. Go to Management Center > Website Application
  4. Click Create Website Application
  5. Fill in the application information and submit for review

Configure OAuth Settings

After your application is approved:

  1. Go to your application settings
  2. In Website Information, configure the callback domain

<Callout type={'info'}> Callback domain format:

- **Callback Domain**: `your-domain.com` (without protocol or path)
- **Full Callback URL**: `https://your-domain.com/api/auth/callback/wechat`
</Callout>
  1. Note down the AppID and AppSecret

Configure Environment Variables

Environment VariableTypeDescription
AUTH_SECRETRequiredSession encryption key, generate with openssl rand -base64 32
AUTH_SSO_PROVIDERSRequiredSet to wechat
AUTH_WECHAT_IDRequiredAppID from WeChat Open Platform
AUTH_WECHAT_SECRETRequiredAppSecret from WeChat Open Platform

<Callout type={'tip'}> Go to 📘 Environment Variables for detailed information. </Callout> </Steps>

<Callout type={'info'}> After successful deployment, users will be able to authenticate with WeChat and use LobeHub. </Callout>

Notes

  • WeChat login uses QR code scanning, users need to use WeChat mobile app
  • A verified WeChat Open Platform account is required
  • The callback domain must be filed with ICP in China