0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/packages/connector-apple
2022-07-07 16:40:33 +00:00
..
docs docs(apple-connector): readme (en-US) (#1329) 2022-07-01 22:24:18 +08:00
src chore(connector): update connectors description (#1397) 2022-07-04 04:20:28 +00:00
CHANGELOG.md release: v1.0.0-alpha.3 2022-07-07 16:40:33 +00:00
jest.config.ts feat(connectors): handle authorization callback parameters in each connector respectively (#1166) 2022-06-26 18:03:53 +08:00
logo-dark.svg chore(connector): update apple connector logos (#1396) 2022-07-04 06:54:25 +00:00
logo.svg chore(connector): update apple connector logos (#1396) 2022-07-04 06:54:25 +00:00
package.json release: v1.0.0-alpha.3 2022-07-07 16:40:33 +00:00
README.md docs(apple-connector): readme (en-US) (#1329) 2022-07-01 22:24:18 +08:00
tsconfig.base.json feat(connector): apple (#966) 2022-05-27 15:43:42 +08:00
tsconfig.build.json feat(connector): apple (#966) 2022-05-27 15:43:42 +08:00
tsconfig.json feat(connectors): handle authorization callback parameters in each connector respectively (#1166) 2022-06-26 18:03:53 +08:00
tsconfig.test.json feat(connector): apple (#966) 2022-05-27 15:43:42 +08:00

Apple connector

The official Logto connector for Apple social sign-in.

Apple 社交登录 Logto 官方连接器 中文文档

Table of contents

Get started

If you don't know the concept of the connector or haven't added this connector to your Sign-in experience yet, please see Logto tutorial.

Note

Apple sign-in is required for AppStore if you have other social sign-in methods in your app. Having Apple sign-in on Android devices is great if you also provide an Android app.

You need to enroll Apple Developer Program before continuing.

Enable Sign in with Apple for your app

⚠️ Caution

Even if you want to implement Sign in with Apple on a web app only, you still need to have an existing app that embraces the AppStore ecosystem (i.e., a valid App ID).

You can do it via Xcode -> Project settings -> Signing & Capabilities, or visit Certificates, Identifiers & Profiles.

Enable Sign in with Apple

See the "Enable an App ID" section in Apple official docs for more info.

Create an identifier

  1. Visit Certificates, Identifiers & Profiles, then click the "+" button next to "Identifier".
  2. In the "Register a new identifier" page, choose "Services IDs" and click "Continue".
  3. Fill out "Description" and "Identifier" (E.g., Logto Test and io.logto.test), then click "Continue".
  4. Double-check the info and click "Register".

Enable Sign in with Apple for your identifier

Click the identifier you just created. Check "Sign in with Apple" on the details page and click "Configure".

Enable Sign in with Apple

In the opening modal, select the App ID you just enabled.

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/apple-universal, e.g., https://your.logto.domain/callback/apple-universal.

domain-and-url

Click "Next" then "Done" to close the modal. Click "Continue" on the top-right corner, then click "Save" to save your configuration.

⚠️ Caution

Apple does NOT allow HTTP protocol and localhost domain.

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 can help you for setting up local HTTPS.

Compose the connector JSON

You need to use the identifier that fills in the Create an identifier section to compose the JSON:

{
  "clientId": "io.logto.test"
}

Test Apple connector

That's it. The Apple connector should be available in both web and native apps. Don't forget to Enable connector in sign-in experience.