0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

chore(connector): improve DingTalk web connector readme (#5977)

* feat: add dingtalk connector

* refactor(connector): optimize codes

* refactor(connector): optimize the logic of getting user phone

* docs(connector): add English configuration guide for DingTalk

* docs(connector): add table of contents

* docs(connector): optimize format

* chore(connector): update DingTalk web connector readme

* chore(connector): apply suggestions from code review

Co-authored-by: Darcy Ye <darcyye@silverhand.io>
Co-authored-by: Charles Zhao <charleszhao@silverhand.io>

---------

Co-authored-by: aidenlu <aiden_lu@wochacha.com>
Co-authored-by: Darcy Ye <darcyye@silverhand.io>
Co-authored-by: Charles Zhao <charleszhao@silverhand.io>
This commit is contained in:
aiden 2024-06-04 10:31:05 +08:00 committed by GitHub
parent acc22af0b2
commit f4e64922fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 25 deletions

View file

@ -12,6 +12,7 @@ The official Logto connector for DingTalk social sign-in in web apps.
- [Register a DingTalk Developer Account](#register-a-dingtalk-developer-account)
- [Create an Application](#create-an-application)
- [Configure Permissions](#configure-permissions)
- [Release Application](#release-application)
- [Configure Your Connector](#configure-your-connector)
- [Config Types](#config-types)
- [Test DingTalk Connector](#test-dingtalk-connector)
@ -22,6 +23,7 @@ The official Logto connector for DingTalk social sign-in in web apps.
- [注册钉钉开发者账号](#注册钉钉开发者账号)
- [创建应用](#创建应用)
- [配置权限](#配置权限)
- [应用发布](#应用发布)
- [配置你的连接器](#配置你的连接器)
- [配置类型](#配置类型)
- [测试钉钉连接器](#测试钉钉连接器)
@ -34,7 +36,6 @@ The DingTalk web connector is designed for desktop web applications. It uses the
## Create a web app in the DingTalk Open Platform
> 💡 **Tip**
>
> You can skip some sections if you have already finished.
### Register a DingTalk developer account
@ -43,19 +44,21 @@ If you do not have a DingTalk developer account, please register at the [DingTal
### Create an application
1. In the [DingTalk Developer Console](https://open-dev.dingtalk.com/console/index), click "Create Application"
2. Choose "Self-built Application", fill in the application name and basic information, and click "Create"
3. In the left navigation bar, select "Development Configuration" -> "Security Settings", find and configure the "Redirect URL" `${your_logto_origin}/callback/${connector_id}`. You can find the `connector_id` on the connector details page after adding the respective connector in the management console
4. In the left navigation bar, select "Basic Information" -> "Credentials and Basic Information" to get the "Client ID" and "Client Secret"
5. In the left navigation bar, select "Application Release" -> "Version Management and Release", create and release the first version to activate the "Client ID" and "Client Secret"
> **Note**
> If the application does not release a version, the obtained "Client ID" and "Client Secret" cannot be used, or requests will fail.
1. In the DingTalk Open Platform "[Application Development](https://open-dev.dingtalk.com/fe/app)" > "Internal Enterprise Application" > "DingTalk Application", click "Create Application"
2. Fill in the **application name** and **description**, and click "Save"
3. In the left navigation bar, select "Development Configuration" > "Security Settings", find and configure the "Redirect URL" `${your_logto_origin}/callback/${connector_id}`. You can find the `connector_id` on the connector details page after adding the respective connector in the management console
4. In the left navigation bar, select "Basic Information" > "Credentials and Basic Information" to get the `Client ID` and `Client Secret`
### Configure permissions
1. In "Development Configuration" -> "Permission Management", select `Contact.User.Read` and `Contact.User.mobile` permissions and authorize them
2. After confirming the permission configuration, click "Save" and publish the application
In "Development Configuration" > "Permission Management", select `Contact.User.Read` and `Contact.User.mobile` permissions and authorize them
### Release Application
In the left navigation bar, select "Application Release" > "Version Management and Release", create and release the first version to activate the `Client ID` and `Client Secret`
> **Note**
> If the application does not release a version, the obtained "Client ID" and "Client Secret" cannot be used, or requests will fail.
## Configure your connector
@ -93,7 +96,6 @@ If you have any questions or need further assistance, please visit the [DingTalk
## 在钉钉开放平台新建一个应用
> 💡 **Tip**
>
> 你可以跳过已经完成的部分。
### 注册钉钉开发者账号
@ -102,25 +104,27 @@ If you have any questions or need further assistance, please visit the [DingTalk
### 创建应用
1. 在 [钉钉开发者后台](https://open-dev.dingtalk.com/console/index) 中,点击「创建应用」
2. 选择「自建应用」,填写应用名称和基本信息,点击「创建」
3. 在左侧导航栏选择「开发配置」->「安全设置」,找到并配置「重定向 URL」 `${your_logto_origin}/callback/${connector_id}`。其中 `connector_id` 在管理控制台添加了相应的连接器之后,可以在连接器的详情页中找到
4. 在左侧导航栏选择「基础信息」->「凭证与基础信息」中可以获取「Client ID」、「Client Secret」
5. 在左侧导航栏选择「应用发布」->「版本管理与发布」创建并发布第一个版本以使「Client ID」、「Client Secret」生效
1. 在 钉钉开放平台「[应用开发](https://open-dev.dingtalk.com/fe/app)」>「企业内部应用」>「钉钉应用」中,点击「创建应用」
2. 填写**应用名称**和**应用描述**,点击「保存」
3. 在左侧导航栏选择「开发配置」>「安全设置」,找到并配置「重定向 URL」 `${your_logto_origin}/callback/${connector_id}`。其中 `connector_id` 在管理控制台添加了相应的连接器之后,可以在连接器的详情页中找到
4. 在左侧导航栏选择「基础信息」>「凭证与基础信息」中可以获取「Client ID」、「Client Secret」
### 配置权限
在「开发配置」>「权限管理」中,选择`通讯录个人信息读权限`和`个人手机号信息`权限并进行授权
### 应用发布
在左侧导航栏选择「应用发布」>「版本管理与发布」点击「创建新版本」发布第一个版本以使「Client ID」、「Client Secret」生效
> **Note**
> 应用不发布版本所获取的「Client ID」、「Client Secret」 均无法使用,或请求错误。
### 配置权限
1. 在「开发配置」->「权限管理」中,选择`通讯录个人信息读权限`和`个人手机号信息`权限并进行授权
2. 确认权限配置后,点击「保存」并发布应用
## 配置你的连接器
在 clientId 和 clientSecret 字段中填入你在上一个部分中提到的 OAuth 应用详情页面获取的 Client ID(原 AppKey 和 SuiteKey) 和 Client Secret(原 AppKey 和 SuiteKey)
`clientId``clientSecret` 字段中填入你在上一个部分中提到的 OAuth 应用详情页面获取的 _Client ID_(原 AppKey 和 SuiteKey_Client Secret_(原 AppKey 和 SuiteKey
scope 目前支持两种值openid 和 openid corpid。openid 授权后可以获取用户的 userid而 openid corpid 授权后可以获取用户的 id 和登录过程中用户选择的组织 id。这些值应以空格分隔。注意:需要进行 URL 编码。
`scope` 目前支持两种值:`openid` 和 `openid corpid`。`openid` 授权后可以获取用户的 `userid`,而 `openid corpid` 授权后可以获取用户的 `id` 和登录过程中用户选择的组织 `id`。这些值应以空格分隔。注意:需要进行 URL 编码。
### 配置类型

View file

@ -15689,7 +15689,7 @@ snapshots:
deepmerge: 4.3.1
is-builtin-module: 3.2.1
is-module: 1.0.0
resolve: 1.22.2
resolve: 1.22.8
optionalDependencies:
rollup: 4.14.3