Skip to main content

Setup

1

Get credentials

Go to the WeChat Open Platform and register a website app. Set the authorization callback domain (not a full URL, just the domain):
theAuth will handle the path /api/theauth/auth/oauth/callback/wechat.
2

Configure

lib/theauth.ts

Scopes

Default scopes: snsapi_login
WeChat uses appid and secret rather than the standard client_id / client_secret naming, but theAuth maps these correctly. The WeChat Open Platform requires ICP filing for mainland China deployments.
This is a preset built on the generic OIDC factory, which reads the user from https://api.weixin.qq.com/sns/userinfo and requires the response to contain the OIDC sub and email fields. That endpoint returns an openid field and no email, so sign-in is expected to fail with WeChat userinfo response missing required "sub" field. This preset has not been verified against the live service.

Endpoints

Last modified on October 18, 2026