Add WeCom as an OAuth provider
This guide explains how to let users sign in to Casdoor from the WeCom (WeChat Work) client. You can connect an internal application or a third-party application of WeCom.
Learning outcomes
- Choose the sub type, the method, and the scope.
- Add WeCom as an OAuth provider in Casdoor.
What you need
- A WeCom enterprise and an application in it. See Internal applications or Third-party applications.
- Administrator access to the Casdoor admin console
Add the provider in Casdoor
-
In the Casdoor admin console, go to Identity > Providers and add a provider.
-
Set Category to
OAuthand Type toWeCom. -
Fill in the fields:
Casdoor field Descripción Sub type Interno o de Terceros Method Silencioso o Normal Client ID Enterprise CorpID Client secret Enterprise CorpSecret Agent ID Application AgentId Alcance snsapi_userinfo(default) orsnsapi_privateinfo -
Save the provider.
Methods
| Method | Behavior |
|---|---|
Silent | WeCom redirects the user to redirect_uri?code=CODE&state=STATE without asking |
Normal | WeCom shows a consent page and redirects after the user agrees |
See WeCom OAuth.
Scopes
| Alcance | Data |
|---|---|
snsapi_userinfo | The basic profile, without the email address |
snsapi_privateinfo | Also the email address and other sensitive data. The administrator of the enterprise must grant the application the permission for sensitive member information |
Use snsapi_privateinfo if Casdoor should fill in the email address of users from WeCom.
Next steps
Add the provider to an application. See Add providers to an application.