Chuyển tới nội dung chính

Add DingTalk as an OAuth provider

This guide explains how to let users sign in to Casdoor with their DingTalk account.


Learning outcomes​

  • Configure a DingTalk application for Casdoor.
  • Add DingTalk as an OAuth provider in Casdoor.

What you need​


Configure the DingTalk application​

  1. Open your application on the DingTalk Open Platform and note its AppKey and AppSecret.

    DingTalk application credentials

  2. Add the domain of Casdoor, for example https://your-casdoor.com, as the redirect domain.

    Redirect domain of the application

  3. Under Permissions Management, turn on Contact.User.Read. Casdoor needs it to read the user from /v1.0/contact/users/me. Without it, sign-in fails.

    Contact.User.Read permission

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 DingTalk.

  3. Fill in the fields:

    CasdoorDingTalk
    Client IDAppKey
    Client secretAppSecret

    DingTalk provider in Casdoor

  4. Save the provider.

Casdoor uses the unionid of DingTalk as the username, so that a user keeps the same account when other details change.

Next steps​

Add the provider to an application. See Add providers to an application.

See also​