Apple Authentication
Configuring Apple Authentication for Application
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
-
Go to the Apple Developer Portal:
- Log in to your Apple Developer account.
-
Select Your App ID:
- Navigate to "Certificates, Identifiers & Profiles" > "Identifiers."
- Find and select your App ID from the list.
- Enable "Sign In with Apple":
- Under the "Capabilities" section, enable "Sign In with Apple."
- Save the changes.
- Create Service ID for Apple Authentification for Web :
- Go to "Identifiers" in the Apple Developer Portal.
- Register a new identifier for Service IDs
Create new Identifier using reverse-domain style naming convention, example : com.expostarter.apple.auth
Configure Your Project
Update your configuration file apps/your-app/config.ts
with the following information:
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.
Update .env
to verify jwt token from Apple
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
-
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.
-
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.