@logto/connector-dingtalk-web 0.0.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -26
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ The official Logto connector for DingTalk social sign-in in web apps.
|
|
|
12
12
|
- [Register a DingTalk Developer Account](#register-a-dingtalk-developer-account)
|
|
13
13
|
- [Create an Application](#create-an-application)
|
|
14
14
|
- [Configure Permissions](#configure-permissions)
|
|
15
|
+
- [Release Application](#release-application)
|
|
15
16
|
- [Configure Your Connector](#configure-your-connector)
|
|
16
17
|
- [Config Types](#config-types)
|
|
17
18
|
- [Test DingTalk Connector](#test-dingtalk-connector)
|
|
@@ -22,6 +23,7 @@ The official Logto connector for DingTalk social sign-in in web apps.
|
|
|
22
23
|
- [注册钉钉开发者账号](#注册钉钉开发者账号)
|
|
23
24
|
- [创建应用](#创建应用)
|
|
24
25
|
- [配置权限](#配置权限)
|
|
26
|
+
- [应用发布](#应用发布)
|
|
25
27
|
- [配置你的连接器](#配置你的连接器)
|
|
26
28
|
- [配置类型](#配置类型)
|
|
27
29
|
- [测试钉钉连接器](#测试钉钉连接器)
|
|
@@ -34,7 +36,6 @@ The DingTalk web connector is designed for desktop web applications. It uses the
|
|
|
34
36
|
## Create a web app in the DingTalk Open Platform
|
|
35
37
|
|
|
36
38
|
> 💡 **Tip**
|
|
37
|
-
>
|
|
38
39
|
> You can skip some sections if you have already finished.
|
|
39
40
|
|
|
40
41
|
### Register a DingTalk developer account
|
|
@@ -43,19 +44,21 @@ If you do not have a DingTalk developer account, please register at the [DingTal
|
|
|
43
44
|
|
|
44
45
|
### Create an application
|
|
45
46
|
|
|
46
|
-
1. In the
|
|
47
|
-
2.
|
|
48
|
-
3. In the left navigation bar, select "Development Configuration"
|
|
49
|
-
4. In the left navigation bar, select "Basic Information"
|
|
50
|
-
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"
|
|
51
|
-
|
|
52
|
-
> ℹ️ **Note**
|
|
53
|
-
> If the application does not release a version, the obtained "Client ID" and "Client Secret" cannot be used, or requests will fail.
|
|
47
|
+
1. In the DingTalk Open Platform "[Application Development](https://open-dev.dingtalk.com/fe/app)" > "Internal Enterprise Application" > "DingTalk Application", click "Create Application"
|
|
48
|
+
2. Fill in the **application name** and **description**, and click "Save"
|
|
49
|
+
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
|
|
50
|
+
4. In the left navigation bar, select "Basic Information" > "Credentials and Basic Information" to get the `Client ID` and `Client Secret`
|
|
54
51
|
|
|
55
52
|
### Configure permissions
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
In "Development Configuration" > "Permission Management", select `Contact.User.Read` and `Contact.User.mobile` permissions and authorize them
|
|
55
|
+
|
|
56
|
+
### Release Application
|
|
57
|
+
|
|
58
|
+
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`
|
|
59
|
+
|
|
60
|
+
> ℹ️ **Note**
|
|
61
|
+
> If the application does not release a version, the obtained "Client ID" and "Client Secret" cannot be used, or requests will fail.
|
|
59
62
|
|
|
60
63
|
## Configure your connector
|
|
61
64
|
|
|
@@ -73,7 +76,7 @@ Fill out the `clientId` and `clientSecret` field with _Client ID(formerly AppKey
|
|
|
73
76
|
|
|
74
77
|
## Test DingTalk connector
|
|
75
78
|
|
|
76
|
-
That's it. The DingTalk connector should be available now. Don't forget to [Enable connector in sign-in experience](https://docs.logto.io/docs/
|
|
79
|
+
That's it. The DingTalk connector should be available now. Don't forget to [Enable connector in sign-in experience](https://docs.logto.io/docs/recipes/configure-connectors/social-connector/enable-social-sign-in/).
|
|
77
80
|
|
|
78
81
|
Once DingTalk web connector is enabled, you can sign in to your app again to see if it works.
|
|
79
82
|
|
|
@@ -93,7 +96,6 @@ If you have any questions or need further assistance, please visit the [DingTalk
|
|
|
93
96
|
## 在钉钉开放平台新建一个应用
|
|
94
97
|
|
|
95
98
|
> 💡 **Tip**
|
|
96
|
-
>
|
|
97
99
|
> 你可以跳过已经完成的部分。
|
|
98
100
|
|
|
99
101
|
### 注册钉钉开发者账号
|
|
@@ -102,25 +104,27 @@ If you have any questions or need further assistance, please visit the [DingTalk
|
|
|
102
104
|
|
|
103
105
|
### 创建应用
|
|
104
106
|
|
|
105
|
-
1. 在 [
|
|
106
|
-
2.
|
|
107
|
-
3.
|
|
108
|
-
4.
|
|
109
|
-
5. 在左侧导航栏选择「应用发布」->「版本管理与发布」,创建并发布第一个版本,以使「Client ID」、「Client Secret」生效
|
|
110
|
-
|
|
111
|
-
> ℹ️ **Note**
|
|
112
|
-
> 应用不发布版本,所获取的「Client ID」、「Client Secret」 均无法使用,或请求错误。
|
|
107
|
+
1. 在 钉钉开放平台「[应用开发](https://open-dev.dingtalk.com/fe/app)」>「企业内部应用」>「钉钉应用」中,点击「创建应用」
|
|
108
|
+
2. 填写**应用名称**和**应用描述**,点击「保存」
|
|
109
|
+
3. 在左侧导航栏选择「开发配置」>「安全设置」,找到并配置「重定向 URL」 `${your_logto_origin}/callback/${connector_id}`。其中 `connector_id` 在管理控制台添加了相应的连接器之后,可以在连接器的详情页中找到
|
|
110
|
+
4. 在左侧导航栏选择「基础信息」>「凭证与基础信息」中可以获取「Client ID」、「Client Secret」
|
|
113
111
|
|
|
114
112
|
### 配置权限
|
|
115
113
|
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
在「开发配置」>「权限管理」中,选择`通讯录个人信息读权限`和`个人手机号信息`权限并进行授权
|
|
115
|
+
|
|
116
|
+
### 应用发布
|
|
117
|
+
|
|
118
|
+
在左侧导航栏选择「应用发布」>「版本管理与发布」,点击「创建新版本」发布第一个版本,以使「Client ID」、「Client Secret」生效
|
|
119
|
+
|
|
120
|
+
> ℹ️ **Note**
|
|
121
|
+
> 应用不发布版本,所获取的「Client ID」、「Client Secret」 均无法使用,或请求错误。
|
|
118
122
|
|
|
119
123
|
## 配置你的连接器
|
|
120
124
|
|
|
121
|
-
在 clientId 和 clientSecret 字段中填入你在上一个部分中提到的 OAuth 应用详情页面获取的
|
|
125
|
+
在 `clientId` 和 `clientSecret` 字段中填入你在上一个部分中提到的 OAuth 应用详情页面获取的 _Client ID_(原 AppKey 和 SuiteKey)和 _Client Secret_(原 AppKey 和 SuiteKey)。
|
|
122
126
|
|
|
123
|
-
scope
|
|
127
|
+
`scope` 目前支持两种值:`openid` 和 `openid corpid`。`openid` 授权后可以获取用户的 `userid`,而 `openid corpid` 授权后可以获取用户的 `id` 和登录过程中用户选择的组织 `id`。这些值应以空格分隔。注意:需要进行 URL 编码。
|
|
124
128
|
|
|
125
129
|
### 配置类型
|
|
126
130
|
|
|
@@ -132,7 +136,7 @@ scope 目前支持两种值:openid 和 openid corpid。openid 授权后可以
|
|
|
132
136
|
|
|
133
137
|
## 测试钉钉连接器
|
|
134
138
|
|
|
135
|
-
大功告成。别忘了 [在登录体验中启用本连接器](https://docs.logto.io/docs/
|
|
139
|
+
大功告成。别忘了 [在登录体验中启用本连接器](https://docs.logto.io/docs/recipes/configure-connectors/social-connector/enable-social-sign-in/)。
|
|
136
140
|
|
|
137
141
|
在钉钉web连接器启用后,你可以构建并运行你的应用看看是否生效。
|
|
138
142
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/connector-dingtalk-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Dingtalk web connector implementation.",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@logto/connector-kit": "^
|
|
6
|
+
"@logto/connector-kit": "^4.0.0",
|
|
7
7
|
"@silverhand/essentials": "^2.9.1",
|
|
8
8
|
"dayjs": "^1.10.5",
|
|
9
9
|
"got": "^14.0.0",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"zod": "^3.22.4"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@rollup/plugin-commonjs": "^
|
|
15
|
+
"@rollup/plugin-commonjs": "^26.0.0",
|
|
16
16
|
"@rollup/plugin-json": "^6.1.0",
|
|
17
17
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
18
18
|
"@rollup/plugin-typescript": "^11.1.6",
|