Authentification

Apple Authentication

Configuring Apple Authentication for Application

iOS
Web

This guide will walk you through the steps to set up Apple Authentication in your Expo app for web and iOS.

Before getting started, make sure you have An Apple Developer account.

Enable Sign In with Apple in Your Apple Developer Account

  1. Go to the Apple Developer Portal:

  2. Select Your App ID:

    • Navigate to "Certificates, Identifiers & Profiles" > "Identifiers."
    • Find and select your App ID from the list.

  1. Enable "Sign In with Apple":
    • Under the "Capabilities" section, enable "Sign In with Apple."
    • Save the changes.

Registre new new app

  1. Create Service ID for Apple Authentification for Web :
    • Go to "Identifiers" in the Apple Developer Portal.
    • Register a new identifier for Service IDs Registre new new app

Create new Identifier using reverse-domain style naming convention, example : com.expostarter.apple.auth Registre new new app

Registre new new app

Registre new new app

Configure Your Project

Update your configuration file apps/your-app/config.ts with the following information:

config.ts
  authentification: {
   ...
    apple: {
      webClientId: "com.expostarter.apple.auth"
    }
  },

Replace com.expostarter.apple.auth and com.expostarter.app with the identifiers you created in the Apple Developer Portal.

Enable Apple Authentication in your project

Expo Starter is already configured to support Apple Authentication.

app.config.ts
const APP_ID_PREFIX = "com.expostarter.app";
const USES_APPLE_SIGN_IN = true

Update .env to verify jwt token from Apple

.env
APPLE_AUTH_CLIENT_ID=com.expostarter.apple.auth, com.expostarter.app, com.expostarter.app.preview

You can use the <AppleLoginButton /> component to add the Sign In with Apple button to your app that works for both web and iOS.

Test Your Setup

  1. Run Your App on a Simulator or Device:

    • If you're using a simulator, make sure it supports iOS 13 or later (required for Sign In with Apple).
    • If you have a device, you can test the authentication flow more accurately.
  2. Test the Sign In with Apple Button in Web:

    • "Sign in with Apple" only works on production, make sure you set the domain name in step 2.

Deploy and Review

Once you've tested everything, you're ready to deploy your app. Remember that Apple requires apps that offer third-party sign-in (such as Google or Facebook) to also offer Sign In with Apple.

On this page