> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magic.link/llms.txt
> Use this file to discover all available pages before exploring further.

# Apple Social Login with Magic

> You can allow your users to sign up & log in to your web app with their Apple ID.

## Usage

### Prerequisites

* You will need an [Apple developer](https://developer.apple.com/) account
* You will need to have [created a primary **App ID**](https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/DevPortalGuide/CreatingandConfiguringAppIDs/CreatingandConfiguringAppIDs.html) for your Apple developer account
* You will need to have the [Magic SDK installed](/embedded-wallets/sdk/overview) into your web app
* You will need to have the [Magic SDK - OAuth Extension](/embedded-wallets/authentication/login/oauth/oauth-implementation) installed into your web app

### Apple Setup

After installing the OAuth extension, you can now enable Sign in with Apple for your Magic app. You'll need to collect credentials from Apple first, then configure Magic.

**Step 1: Collect Apple Credentials**

1. Go to your [Apple developer dashboard](https://developer.apple.com/account)
2. Navigate to [Membership details](https://developer.apple.com/account/#/membership)
3. Find and copy your **Team ID** (you'll need this later for Magic Dashboard)
4. If you have not already created an Apple key, under **Certificates, IDs & Profiles** select **Keys**
5. On the Keys page, click the blue plus button to create a new key. Make sure to enable **Sign in with Apple**.

<Frame>
  <img src="https://mintcdn.com/magic-newton/938YkKtGm_H2ir72/images/apple-key.png?fit=max&auto=format&n=938YkKtGm_H2ir72&q=85&s=2c078b2ff242a5d4a9af8a855e6cada4" alt="Apple developer portal Keys page showing blue plus button to create a new key" width="2452" height="1404" data-path="images/apple-key.png" />
</Frame>

6. Complete the key setup and securely store your **Private Key** file and **Key ID** (you'll need both for Magic Dashboard)
7. In Apple's dashboard, navigate to **Identifiers** under [Certificates, IDs, & Profiles](https://developer.apple.com/account/resources/identifiers/list/serviceId)
8. Add a new [Services ID](https://developer.apple.com/account/resources/identifiers/add/serviceId) for your Magic authentication connection. Click **Continue**, then click **Register**

<Frame>
  <img src="https://mintcdn.com/magic-newton/1GYf0YW8BthDpWqo/images/add-services-id.webp?fit=max&auto=format&n=1GYf0YW8BthDpWqo&q=85&s=f0219cd84009560877ec7e511cde9ffe" alt="Apple developer portal showing Services ID creation form" width="1200" height="504" data-path="images/add-services-id.webp" />
</Frame>

9. Click your newly created Services ID to enable it for **Sign in with Apple**. Then, click **Configure**

<Frame>
  <img src="https://mintcdn.com/magic-newton/1GYf0YW8BthDpWqo/images/enable-sign-in-with-apple.webp?fit=max&auto=format&n=1GYf0YW8BthDpWqo&q=85&s=3a8ec6cab408f1a61e6edb8153f1ab65" alt="Apple Services ID settings with Sign in with Apple configuration option" width="1200" height="450" data-path="images/enable-sign-in-with-apple.webp" />
</Frame>

10. In the configuration modal, whitelist your app's domain in **Domains & Subdomains**, and add your **Redirect URI** in the **Return URLs** field:

    Add the **Redirect URI** you are passing as the **redirectURI** argument to the **loginWithRedirect** method:

    ```javascript JavaScript icon="square-js" theme={null}
    await magic.oauth2.loginWithRedirect({
      provider: 'apple',
      redirectURI: 'https://your-app.com/your/oauth/callback', // whitelist this with Apple
    });
    ```

<Frame>
  <img src="https://mintcdn.com/magic-newton/938YkKtGm_H2ir72/images/apple-redirect.png?fit=max&auto=format&n=938YkKtGm_H2ir72&q=85&s=6922a512a0614c74e77ef03661fb3c8a" alt="Apple Services ID configuration modal showing Domains and Return URLs input fields" width="1436" height="1538" data-path="images/apple-redirect.png" />
</Frame>

11. Click **Continue**, then **Save** to save your Services ID configuration

**Step 2: Configure Magic Dashboard**

12. Go to your [Magic Dashboard](https://dashboard.magic.link/login)
13. Select the Magic app for which you'd like to enable Sign in with Apple, or create a new app
14. Navigate to **Social Login** from the sidebar
15. Click the toggle for **Apple**
16. Input your Apple credentials: **Team ID**, **Services ID**, **Key ID**, and paste the contents of your **Private Key** file
17. Click **Save**

## Resources

* [Apple Social Login Demo](https://magic-oauth-v2-nine.vercel.app/)
