Skip to content

Conversation

@naokij
Copy link
Contributor

@naokij naokij commented May 12, 2025

Description

This PR adds OAuth2 authentication support for DingTalk. DingTalk is an enterprise collaboration and communication platform developed by Alibaba Group and is widely used in China.

Main Features

  • Supports the standard OAuth2 authentication process.
  • Supports company ID verification (optional).
  • Supports token refresh.
  • Provides detailed documentation and examples.
  • Adds comprehensive testing.

Configuration Example

dingTalkProvider := dingtalk.New(
    os.Getenv("DINGTALK_KEY"), 
    os.Getenv("DINGTALK_SECRET"), 
    "http://localhost:3000/auth/dingtalk/callback", 
    os.Getenv("DINGTALK_CORP_ID"), // Used for company verification. Can be set as an empty string if not needed.
    "openid", 
    "corpid" // Must be included in the scope when company verification is required.
)
goth.UseProviders(dingTalkProvider)

Testing

Test cases have been added to cover the main functions.

Related Links

@techknowlogick techknowlogick merged commit 44c60d8 into markbates:master Aug 22, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants