Skip to main content

Usage

Prerequisites

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
  2. Navigate to Membership details
  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.
Apple developer portal Keys page showing blue plus button to create a new key
  1. Complete the key setup and securely store your Private Key file and Key ID (you’ll need both for Magic Dashboard)
  2. In Apple’s dashboard, navigate to Identifiers under Certificates, IDs, & Profiles
  3. Add a new Services ID for your Magic authentication connection. Click Continue, then click Register
Apple developer portal showing Services ID creation form
  1. Click your newly created Services ID to enable it for Sign in with Apple. Then, click Configure
Apple Services ID settings with Sign in with Apple configuration option
  1. 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
    await magic.oauth2.loginWithRedirect({
      provider: 'apple',
      redirectURI: 'https://your-app.com/your/oauth/callback', // whitelist this with Apple
    });
    
Apple Services ID configuration modal showing Domains and Return URLs input fields
  1. Click Continue, then Save to save your Services ID configuration
Step 2: Configure Magic Dashboard
  1. Go to your Magic Dashboard
  2. Select the Magic app for which you’d like to enable Sign in with Apple, or create a new app
  3. Navigate to Social Login from the sidebar
  4. Click the toggle for Apple
  5. Input your Apple credentials: Team ID, Services ID, Key ID, and paste the contents of your Private Key file
  6. Click Save

Resources