@logto/connector-apple 1.0.0-beta.9 → 1.0.0
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 +2 -24
- package/lib/{src/constant.d.ts → constant.d.ts} +1 -1
- package/lib/{src/index.d.ts → index.d.ts} +1 -1
- package/lib/index.js +3132 -7841
- package/lib/{src/types.d.ts → types.d.ts} +1 -1
- package/logo-dark.svg +1 -1
- package/logo.svg +1 -1
- package/package.json +42 -32
- package/docs/config-template.json +0 -3
- package/lib/jest.config.d.ts +0 -3
- package/lib/src/index.test.d.ts +0 -1
- /package/lib/{src/mock.d.ts → mock.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -11,14 +11,12 @@ Apple 社交登录 Logto 官方连接器 [中文文档](#apple-连接器)
|
|
|
11
11
|
- [Enable Sign in with Apple for your app](#enable-sign-in-with-apple-for-your-app)
|
|
12
12
|
- [Create an identifier](#create-an-identifier)
|
|
13
13
|
- [Enable Sign in with Apple for your identifier](#enable-sign-in-with-apple-for-your-identifier)
|
|
14
|
-
- [Compose the connector JSON](#compose-the-connector-json)
|
|
15
14
|
- [Test Apple connector](#test-apple-connector)
|
|
16
15
|
- [Apple 连接器](#apple-连接器)
|
|
17
16
|
- [开始上手](#开始上手)
|
|
18
17
|
- [为你的应用启用「通过 Apple 登录」](#为你的应用启用通过-apple-登录)
|
|
19
18
|
- [创建一个 identifier](#创建一个-identifier)
|
|
20
19
|
- [为你的 identifier 启用「通过 Apple 登录」](#为你的-identifier-启用通过-apple-登录)
|
|
21
|
-
- [编写连接器的 JSON](#编写连接器的-json)
|
|
22
20
|
- [测试 Apple 连接器](#测试-apple-连接器)
|
|
23
21
|
|
|
24
22
|
## Get started
|
|
@@ -59,7 +57,7 @@ Click the identifier you just created. Check "Sign in with Apple" on the details
|
|
|
59
57
|
|
|
60
58
|
In the opening modal, select the App ID you just enabled Sign in with Apple.
|
|
61
59
|
|
|
62
|
-
Enter the domain of your Logto instance without protocol and port, e.g., `your.logto.domain`; then enter the "Return URL" (i.e., Redirect URI), which is the Logto URL with `/callback
|
|
60
|
+
Enter the domain of your Logto instance without protocol and port, e.g., `your.logto.domain`; then enter the "Return URL" (i.e., Redirect URI), which is the Logto URL with `/callback/${connector_id}`, e.g., `https://your.logto.domain/callback/apple-universal`. You can get the randomly generated `connector_id` after creating Apple connector in Admin Console.
|
|
63
61
|
|
|
64
62
|

|
|
65
63
|
|
|
@@ -71,16 +69,6 @@ Click "Next" then "Done" to close the modal. Click "Continue" on the top-right c
|
|
|
71
69
|
>
|
|
72
70
|
> If you want to test locally, you need to edit `/etc/hosts` file to map localhost to a custom domain and set up a local HTTPS environment. [mkcert](https://github.com/FiloSottile/mkcert) can help you for setting up local HTTPS.
|
|
73
71
|
|
|
74
|
-
## Compose the connector JSON
|
|
75
|
-
|
|
76
|
-
You need to use the identifier that fills in the [Create an identifier](#create-an-identifier) section to compose the JSON:
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{
|
|
80
|
-
"clientId": "io.logto.test"
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
72
|
> ℹ️ **Note**
|
|
85
73
|
>
|
|
86
74
|
> This connector doesn't support customizing `scope` (e.g., name, email) yet since Apple requires `form_post` response mode when `scope` is not empty, which is incompatible with the current connector design.
|
|
@@ -131,7 +119,7 @@ That's it. The Apple connector should be available in both web and native apps.
|
|
|
131
119
|
|
|
132
120
|
在打开的对话框中,选择刚刚启用了「通过 Apple 登录」的 App ID。
|
|
133
121
|
|
|
134
|
-
输入你的 Logto 实例域名(不含协议和端口),例如 `your.logto.domain`;并输入「Return URL」(即 Redirect URI)。Return URL 的值是 Logto URL 加上 `/callback
|
|
122
|
+
输入你的 Logto 实例域名(不含协议和端口),例如 `your.logto.domain`;并输入「Return URL」(即 Redirect URI)。Return URL 的值是 Logto URL 加上 `/callback/${connector_id}`,例如 `https://your.logto.domain/callback/apple-universal`。在管理控制台创建了 Apple 连接器之后,在详情页可以找到生成的随机 `connector_id`。
|
|
135
123
|
|
|
136
124
|

|
|
137
125
|
|
|
@@ -143,16 +131,6 @@ That's it. The Apple connector should be available in both web and native apps.
|
|
|
143
131
|
>
|
|
144
132
|
> 如果你想在本地进行测试,你需要编辑 `/etc/hosts` 文件以映射 localhost 到一个自定义域名,并设置一个本地的 HTTPS 环境。[mkcert](https://github.com/FiloSottile/mkcert) 可以帮助你设置本地 HTTPS。
|
|
145
133
|
|
|
146
|
-
## 编写连接器的 JSON
|
|
147
|
-
|
|
148
|
-
你需要使用在 [创建一个 identifier](#创建一个-identifier) 章节中填写的 identifier 来编写此 JSON:
|
|
149
|
-
|
|
150
|
-
```json
|
|
151
|
-
{
|
|
152
|
-
"clientId": "io.logto.test"
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
134
|
> ℹ️ **Note**
|
|
157
135
|
>
|
|
158
136
|
> 本连接器暂时不支持自定义 `scope`(例如 name,email)。因为在 `scope` 非空时,Apple 要求 `response_mode` 为 `form_post`,与现在连接器的设计不兼容。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectorMetadata } from '@logto/connector-
|
|
1
|
+
import type { ConnectorMetadata } from '@logto/connector-kit';
|
|
2
2
|
export declare const issuer = "https://appleid.apple.com";
|
|
3
3
|
export declare const authorizationEndpoint: string;
|
|
4
4
|
export declare const accessTokenEndpoint: string;
|