Pular para o conteúdo principal

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​


Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to OAuth and Type to WeCom.

  3. Fill in the fields:

    Casdoor fieldDescrição
    Sub typeInterno ou Terceirizado
    MethodSilencioso ou Normal
    Client IDEnterprise CorpID
    Client secretEnterprise CorpSecret
    Agent IDApplication AgentId
    Escoposnsapi_userinfo (default) or snsapi_privateinfo
  4. Save the provider.

Methods​

MethodBehavior
SilentWeCom redirects the user to redirect_uri?code=CODE&state=STATE without asking
NormalWeCom shows a consent page and redirects after the user agrees

See WeCom OAuth.

Scopes​

EscopoData
snsapi_userinfoThe basic profile, without the email address
snsapi_privateinfoAlso 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.

See also​