跳到主内容

Add Sign in with Apple

This guide explains how to let users sign in to Casdoor with their Apple ID.


Learning outcomes​

  • Configure an App ID, a Services ID, and a key at Apple.
  • Add Apple as an OAuth provider in Casdoor.

What you need​

  • An Apple Developer account with a membership of the Apple Developer Program
  • Administrator access to the Casdoor admin console

Configure Apple​

  1. Create an App ID, or open an existing one, and turn on Sign in with Apple for it.

    Sign in with Apple capability of the App ID

  2. Create an identifier of the type Services IDs. Its identifier becomes the Client ID in Casdoor.

    Services ID registration

  3. Open the Services ID, turn on Sign in with Apple, and click Configure.

    Services ID configuration

  4. In Return URLs, enter the redirect URL that the Apple provider page in Casdoor shows, for example https://your-casdoor-domain.com/callback. The two values must match exactly.

    Return URLs of the Services ID

  5. Create a key, turn on Sign in with Apple for it, and associate it with your App ID.

    Key configuration

  6. Register the key. Note the Key ID and download the .p8 file at once. Apple lets you download the file only once, so store it securely.

    Key ID and download of the key file

  7. On the Membership page of the Apple Developer portal, note your Team ID.

Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to OAuth and Type to Apple.

  3. Fill in the fields:

    FieldValue
    Client IDThe identifier of the Services ID
    Team IDYour Apple Team ID
    Key IDThe ID of the key
    Key textThe complete content of the .p8 file, including the -----BEGIN and -----END lines
  4. Check that the redirect URL that Casdoor shows is in the Return URLs of the Services ID.

    Apple provider in Casdoor

  5. Save the provider.

Next steps​

Add the provider to an application. See Add providers to an application.

See also​