WeChat Integration
WeChat is a popular Chinese social media service that provides instant messaging along with commerce and payment services. This document goes over the full process from start to finish of getting up and running with WeChat as a Social Login Provider with LoginRadius.
WeChat App Creation
-
You will need to make sure you have a WeChat account created via the WeChat mobile app.
-
On your computer you will need to sign up for a WeChat Developer account at:
Choose 注册 (Register):
-
You will be prompted with a form to create a WeChat Developer account and to link your existing WeChat account to the Developer account.
-
Once you've logged in on your Developer Account go to
管理中心 (Control Center) -> 网站应用 (Website Application)
And hit 创建网站应用 还可创建 (Create a Website Application)
Now, you will either be prompted with the ability to create the application or to fill out a Developer verification form (If the Developer verification form has not been filled out yet, you will need to fill it out as WeChat only allows verified Developers to create apps).
Note: During the application process WeChat will ask for a Callback URL, provide them with the following URL:
-
Once you've successfully created your app you will receive an AppID and AppSecret. Write it down as it will be required later.
Setting up WeChat as a Custom oAuth Social Provider in the LoginRadius Admin Console
-
Go to your LoginRadius Admin Console Under:
Platform Configuration -> Authentication Configuration -> Custom IDPs
Click Add a New Provider
-
Fill out each field as per the instructions provided below:
-
Provider Name: WeChat
-
User Login Endpoint: https://open.weixin.qq.com/connect/qrconnect
-
Access Token Endpoint:
-
If you have an International Official Account use:
-
If you have a China Official Account use:
-
-
Application Key: Your WeChat AppID
-
Application Secret: Your WeChat AppSecret
-
Scope: snsapi_login
-
Response Type: code
-
User Profile Endpoint:
-
If you have an International Official Account use:
-
If you have a China Official Account use:
-
-
Request Token HTTP Method: GET
-
Access Token parameter name for API access: access_token
-
Data Mapping:
WeChat returns datapoints that can be mapped to fields in LoginRadius, for this social login to work the only field that is mandatory is the LoginRadius ID field to the WeChat unionid field:
LoginRadius Field | WeChat Field |
---|---|
ID | unionid |
You can also optionally map other WeChat fields to other LoginRadius fields as desired.
Setting up the Custom WeChat Social Login Icon
Note: For this next step we highly recommend you familiarize yourself with customizing your social provider icons here. Once you're ready to have the WeChat Social Login icon displayed on your website you will need to inject it via code.
See our general all-purpose document on setting up a Custom OAuth Provider Icon for this step here. Once this is complete you should now have WeChat available as a social icon: