Back to Lobehub

Configure Wechat Authentication Service in LobeHub

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

2.1.562.6 KB
Original Source

Configure Wechat Authentication Service

Wechat Configuration Process

<Steps> ### Create a Wechat Application

Click here and then click "Management Center", "Website Application", and "Create Website Application" in sequence.

Fill in the information as required by the official website prompts and submit for review.

After successful creation, click "Application Details" to obtain the AppID and AppSecret.

Configure Environment Variables

When deploying LobeHub, you need to configure the following environment variables:

Environment VariableTypeDescription
AUTH_SECRETRequiredKey used to encrypt Auth.js session tokens. You can generate the key using the command: openssl rand -base64 32
NEXT_AUTH_SSO_PROVIDERSRequiredSelect the Single Sign-On provider for LobeHub. Use github for Github.
WECHAT_CLIENT_IDRequiredClient ID from the Wechat website application details page
WECHAT_CLIENT_SECRETRequiredClient Secret from the Wechat website application details page
AUTH_URLRequiredThis URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. https://example.com/api/auth

<Callout type={'tip'}> Go to 📘 Environment Variables for more details about related variables. </Callout> </Steps>

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