A lightweight DingTalk OAuth2 bridge service that exposes a standard OAuth2/OpenID Connect compatible interface.
It allows applications that support OAuth2 (such as Moodle, Authentik, Casdoor, or other SSO platforms) to authenticate users via DingTalk.
This service converts DingTalk authentication into a standard OAuth2 provider interface, making it easy for third-party systems to integrate DingTalk login.
After the service starts, the following endpoints are available:
authorization_endpoint: http://localhost:8000/oauth2/authorize
token_endpoint: http://localhost:8000/oauth2/token
userinfo_endpoint: http://localhost:8000/userinfo
These endpoints can be used by OAuth clients for authentication.
docker run -d \
-p 8000:8000 \
-e DINGTALK_AUTH_OAUTH2_ISSUER=http://localhost:8000 \
-e DINGTALK_AUTH_OAUTH2_CLIENT_ID=example_client \
-e DINGTALK_AUTH_OAUTH2_CLIENT_SECRET=example_secret \
-e DINGTALK_AUTH_JWT_SECRET=change-me-in-production \
-e DINGTALK_AUTH_DINGTALK_SNS_APP_ID=YOUR_SNS_APP_ID \
-e DINGTALK_AUTH_DINGTALK_SNS_APP_SECRET=YOUR_SNS_APP_SECRET \
-e DINGTALK_AUTH_DINGTALK_REDIRECT_BASE=http://localhost:8000 \
o1298098/dingtalk-auth
services:
dingtalk-oauth-bridge:
image: o1298098/dingtalk-auth
container_name: dingtalk-oauth-bridge
ports:
- "8000:8000"
environment:
# OAuth2 server meta
- DINGTALK_AUTH_OAUTH2_ISSUER=http://localhost:8000
- DINGTALK_AUTH_OAUTH2_CLIENT_ID=example_client
- DINGTALK_AUTH_OAUTH2_CLIENT_SECRET=example_secret
- DINGTALK_AUTH_JWT_SECRET=change-me-in-production
# DingTalk SNS config
- DINGTALK_AUTH_DINGTALK_SNS_APP_ID=YOUR_SNS_APP_ID
- DINGTALK_AUTH_DINGTALK_SNS_APP_SECRET=YOUR_SNS_APP_SECRET
- DINGTALK_AUTH_DINGTALK_REDIRECT_BASE=http://localhost:8000
| Variable | Description |
|---|---|
DINGTALK_AUTH_OAUTH2_ISSUER | OAuth2 issuer URL |
DINGTALK_AUTH_OAUTH2_CLIENT_ID | OAuth2 client ID |
DINGTALK_AUTH_OAUTH2_CLIENT_SECRET | OAuth2 client secret |
DINGTALK_AUTH_JWT_SECRET | Secret used to sign JWT tokens |
DINGTALK_AUTH_DINGTALK_SNS_APP_ID | DingTalk SNS App ID |
DINGTALK_AUTH_DINGTALK_SNS_APP_SECRET | DingTalk SNS App Secret |
DINGTALK_AUTH_DINGTALK_REDIRECT_BASE | Redirect base URL |
Example configuration for an OAuth2 client:
Authorization URL:
http://localhost:8000/oauth2/authorize
Token URL:
http://localhost:8000/oauth2/token
User Info URL:
http://localhost:8000/userinfo
For production deployment:
JWT_SECRETContent type
Image
Digest
sha256:d751c0490…
Size
64 MB
Last updated
6 months ago
docker pull o1298098/dingtalk-auth