website/docs/users-sources/sources/social-logins/wechat/index.md
Allows users to authenticate using their WeChat credentials by configuring WeChat as a federated identity provider via OAuth2.
The following placeholders are used in this guide:
authentik.company is the FQDN of the authentik installation.To integrate WeChat with authentik you will need to register a "Website Application" (网站应用) on the WeChat Open Platform.
authentik.company).:::info This integration uses the WeChat "Website Application" login flow (QR Code login). When users access the login page on a desktop device (Windows/Mac) with the WeChat client installed, they may see a "Fast Login" prompt. :::
To support the integration of WeChat with authentik, you need to create a WeChat OAuth source in authentik.
wechat), and set the following required configurations:
:::info Display new source on login screen For instructions on how to display the new source on the authentik login page, refer to the Add sources to default login page documentation. :::
:::info Embed new source in flow :ak-enterprise For instructions on embedding the new source within a flow, such as an authorization flow, refer to the Source Stage documentation. :::
Source property mappings allow you to modify or gather extra information from sources. See the overview for more information.
The following data is retrieved from WeChat and mapped to the user's attributes in authentik:
| WeChat Field | authentik Attribute | Description |
|---|---|---|
unionid (or openid) | username | Used as the primary identifier. |
nickname | name | The user's display name. |
headimgurl | attributes.headimgurl | URL to the user's avatar. |
sex | attributes.sex | Gender (1=Male, 2=Female). |
city | attributes.city | User's city. |
province | attributes.province | User's province. |
country | attributes.country | User's country. |
WeChat users are identified by their unionid (if available) or openid.
unionid is not returned.:::info WeChat does not provide the user's email address via the API. :::