{"id":30807413,"url":"https://github.com/raycarterlab/dingtalkoauth","last_synced_at":"2026-05-05T06:40:26.874Z","repository":{"id":298425315,"uuid":"829360794","full_name":"RayCarterLab/DingTalkOAuth","owner":"RayCarterLab","description":"OAuth2 With Alibaba‘s DingDing App to Retrieve User Info","archived":false,"fork":false,"pushed_at":"2025-06-17T09:05:45.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-17T10:21:35.540Z","etag":null,"topics":["fastapi","fastapi-sqlalchemy","oauth2","postgresql","python3","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RayCarterLab.png","metadata":{"files":{"readme":"README.cn.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-16T09:20:24.000Z","updated_at":"2025-06-17T09:12:28.000Z","dependencies_parsed_at":"2025-06-17T10:22:02.852Z","dependency_job_id":null,"html_url":"https://github.com/RayCarterLab/DingTalkOAuth","commit_stats":null,"previous_names":["raycarterlab/dingdingoauth","raycarterlab/dingtalkoauth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RayCarterLab/DingTalkOAuth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayCarterLab%2FDingTalkOAuth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayCarterLab%2FDingTalkOAuth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayCarterLab%2FDingTalkOAuth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayCarterLab%2FDingTalkOAuth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RayCarterLab","download_url":"https://codeload.github.com/RayCarterLab/DingTalkOAuth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayCarterLab%2FDingTalkOAuth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273847264,"owners_count":25178647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","fastapi-sqlalchemy","oauth2","postgresql","python3","sqlite"],"created_at":"2025-09-06T02:08:37.670Z","updated_at":"2026-05-05T06:40:21.836Z","avatar_url":"https://github.com/RayCarterLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 钉钉消息发送·用户认证\n\n## 一、主要功能\n* 发送消息：调用钉钉发送消息接口，实现第三方平台向企业发送消息。\n* 获取人员信息：调用钉钉消息接口，实现第三方平获取企业内用户人信息。\n\n## 二、特殊设计\n* 为了让多个环境使用同一个钉钉认证的平台\n* 为了解决内网无法被外网主动访问的问题\n使用【云端部署】+ 【本地部署】的设计模式。\n\n* 云端部署（DeployMode.CLOUD）\n\n使用 Sqlite 作为存储数据库，要求可以访问外网，可以被外网访问。负责发送向钉钉后端发送请求，请求包括向企业内发送消息，获取企业内人员信息。\n* 本地部署（DeployMode.LOCAL）\n\n使用 Postgres 作为数据库，要求可以访问 dingding-be 云端服务，可以被 dingding-be 云端服务访问。钉钉用户的信息存储在本地。\n\n在前端调用后端服务的时候， 前端会调用两个接口，一个接口访问 dingding-be 钉钉云端服务，一个接口请求 dingding-be 钉钉本地服务。\n云端服务，接收到请求之后，会向阿里钉钉服务请求，获取结果，将结果存储在本地。\n本地服务，接收到请求之后，会向 dingding-be 云端服务请求结果。\n\n项目文件夹中 router 有两个文件， cloud 和 local。\ncloud 表示部署在云端时，此文件内的接口会被调用；local 表示部署在边缘端时，此文件内的接口会被调用。\n\n## 三、基本概念\n\n**CorpId**\nCorpId是企业在钉钉中的标识，每个企业拥有唯一的CorpId。\n\n**SuiteKey/SuiteSecret**\nSuiteKey是第三方企业应用的唯一身份标识，SuiteSecret是对应的调用密钥。\n\n\n**AgentId**\n每个应用都拥有唯一的AgentId。企业在钉钉开发者后台创建应用时，或者在企业授权开通第三方企业应用时，系统会自动生成一个AgentId。\n\n更多内容请参考[官方文档](https://open.dingtalk.com/document/org/basic-concepts)\n\n\n## 四、基本流程\n遵循 OAuth2.0 流程，获取用户身份信息。\n\n![image info](./pictures/绑定用户.jpeg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraycarterlab%2Fdingtalkoauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraycarterlab%2Fdingtalkoauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraycarterlab%2Fdingtalkoauth/lists"}