# WechatWork (Third Party) Webpage

This login method is suitable for use in Wechat Browser or Enterprise Wechat Browser, but not for web login in ordinary browsers.

# Prerequisites

You need to prepare the following in total:

  1. Create an Authing Account
  2. Apply for an enterprise WeChat service provider account (opens new window)
  3. Apply and configure an enterprise WeChat web application (opens new window)
  4. Fill in the corporate WeChat web page information in the Authing console

Please make sure that your application is checked to obtain "avatar" and "QR code".

# Find「Enterprise WeChat Web Authorization Login」in the Authing console

Follow the instructions in the figure below to find the「Enterprise WeChat Webpage Authorization login」configuration.

Enterprise WeChat Webpage Authorization login

Then you need to fill in the relevant configuration in the form below:

Enterprise WeChat Webpage Authorization related configuration

# Get enterprise WeChat application configuration

You need to provide the SuiteID of the application, the Secret of the application and the CorpID of the WeChat enterprise:

Get SuiteID and Secret: You can get it atApplication Management-Web Application-Application Details (opens new window).

Obtain CorpID: You can obtain it at Service Provider Information-Basic Information (opens new window)

Then please fill in these three data into the form mentioned above.

# Add IP whitelist

Please add the following IPs to the whitelist:

52.80.250.250 , 140.179.19.50

You can configure it on the Service Provider Information-Basic Information (opens new window) page.

# Configure trusted domain names

Set core.authing.cn as a trusted domain name.

Click「Check trusted domain name ownership」, in the pop-up Modal, you need to download a Txt file:

And fill in Txt file name and Txt file content into the form shown above.

  • Txt Filename usually starts with WW_verify_, Please keep the .txt file suffix!
  • Txt Content: File content, generally a random string of 10-20 digits.

Click the「OK」button:

You should see that the trusted domain name has been successfully verified:

If you encounter any problems, you can contact us here: https://gitter.im/authing-chat/community (opens new window)

A total of two callback links are configured:

  • Data callback URL. The link format is:
https://core.authing.cn/oauth/wechatwork/:userPoolId/redirect/data

Assuming your user pool ID is 5e4cdd055df3df65dc58b97d, the data callback link is:

https://core.authing.cn/oauth/wechatwork/5e4cdd055df3df65dc58b97d/redirect/data
  • Instruction callback URL. The link format is:
https://core.authing.cn/oauth/wechatwork/:userPoolId/redirect/command

Assuming your user pool ID is 5e4cdd055df3df65dc58b97d, the command callback link is:

https://core.authing.cn/oauth/wechatwork/5e4cdd055df3df65dc58b97d/redirect/command

Please fill in the Token and EncodingAESKey in the form mentioned above, and then click Apply for verification:

You should be able to get a success prompt.

The business callback link is different from the callback link configured in the enterprise WeChat. This is the callback link used by Authing to call back user information to you.

If you use Guard, you can leave it blank and fill in 「#」。

If you need to manually access the corporate WeChat scan code to log in, you need to fill in your business callback link. After the user is authorized, Authing will call back the user information to you.

# Next

After the configuration is complete, you can start to formally integrate social login into your system. Authing social login supports four access methods: using JavaScrit SDK, using Guard for Web login form component, using Authing online login page As with manually calling the social login interface, for the applicable scenarios and advantages and disadvantages of each method, please refer to: Social Login Access Guide.