Add Apple Sign-In
Add Sign in with Apple to a React Native app, including the Xcode capability and verifying the identity token on your backend.
This guide covers adding Sign in with Apple to a React Native app using expo-apple-authentication, and the server-side verification step that's easy to skip.
Quick Answer
Enable the Sign in with Apple capability for your bundle identifier in your Apple Developer account and in Xcode, call expo-apple-authentication (or the bare RN equivalent) to get an identity token, then verify that token's signature against Apple's public keys on your backend before trusting it.
Prerequisites
- An Apple Developer Program membership;
- a bundle identifier you control;
- Xcode, since this only runs on iOS.
1. Enable the Capability
In your Apple Developer account, under Certificates, Identifiers & Profiles, select your App ID and enable Sign in with Apple. In Xcode, add the Sign in with Apple capability under Signing & Capabilities; this regenerates your provisioning profile.
2. Request Sign-In from the App
Call the Apple authentication request with the full name and email scopes. Apple returns an identity token (a JWT) plus, on the very first authorization only, the user's name and email in plaintext.
3. Persist the Name and Email Immediately
Apple does not send the name and email again on subsequent sign-ins from the same device/Apple ID pair, only the first time. If your backend doesn't capture and store them on that first call, you cannot retrieve them later, so save them to your user record immediately rather than re-deriving them from a later sign-in.
4. Verify the Identity Token on Your Backend
The identity token is a JWT signed by Apple. Fetch Apple's public keys (JWKS) and verify the token's signature, issuer, audience (your bundle ID / client ID), and expiry before creating or logging in a user. Skipping this step means anyone can forge a sign-in by sending an unsigned or altered token.
Common Issues
The button does nothing the capability isn't enabled in Xcode, or you're testing on a simulator/device without an Apple ID signed in.
Name and email are null after the first sign-in expected Apple behavior; you must have stored them on the first authorization.
Works in development, rejected in App Store review Apple requires Sign in with Apple as an option on any app that also offers other third-party social logins (like Google). Missing it is a common, avoidable rejection reason.
Backend accepts an invalid token you're trusting the client-reported user info instead of verifying the JWT signature server-side.
Verification Checklist
- Sign in with Apple capability is enabled in both the Developer portal and Xcode;
- a sign-in returns an identity token;
- the name/email from the first authorization are captured and stored;
- the backend verifies the identity token against Apple's JWKS before trusting it;
- Sign in with Apple is offered if any other social login is offered, ahead of App Store submission.