Skip to main content
Sign in with Apple comes back in 2026.11.3 because App Review rejected the app under guideline 4.8: an app that offers sign-in with Google must also offer an equivalent option such as Apple. Apple also brings obligations that Google and Microsoft do not have. This page explains each one and how horizon-api handles it (ADR 0135). On-screen behaviour is in Google, Apple and Microsoft.

What Apple requires

Revoke on account deletion

Guideline 5.1.1(v): if the person deletes their account, their Apple tokens must be revoked. Revoking needs a refresh token, which only the exchange of an authorization code returns.

Listen to Apple

Apple sends server-to-server notifications when someone stops using Sign in with Apple, deletes their Apple ID or changes the forwarding of their hidden e-mail.

Hidden e-mail

“Hide My Email” hands out a @privaterelay.appleid.com address that only accepts mail from domains registered with Apple.

The name arrives once

Apple sends the first and last name only on the app’s first authorization. Later sign-ins carry no name.

Native on iOS, Services ID on Android and the web

That is why Supabase lists as Client IDs the Services ID and every bundle ID of the environment (the native identity token carries the bundle ID as audience), and horizon-api uses the same ids in APPLE_CLIENT_IDS, in the opposite order: the bundle IDs first and the Services ID last, with the Services ID also in APPLE_SERVICES_ID (Rollout).

The client secret

Apple does not use a fixed secret: the client secret is an ES256 JWT signed with the environment’s .p8 key (APPLE_TEAM_ID, APPLE_KEY_ID, APPLE_PRIVATE_KEY), with audience https://appleid.apple.com and a validity of at most 6 months.
If the Supabase secret expires, the browser Apple sign-in fails on Android and the web. The procedure and the five-month reminder are in Operations and maintenance. Rotating it signs nobody out.

The refresh token, encrypted

Apple’s refresh token is stored in the auth_provider_credential table, one row per login and provider:
  • Encryption uses its own keyring, AUTH_PROVIDER_TOKEN_KEYRING (current and previous keys, re-encrypted on read), never the GoTrue bridge keyring.
  • The table has RLS and only the service role reads it.

Revocation on account deletion

When the person deletes their account in Settings, softDeleteLogin revokes the stored token of each Apple login at appleid.apple.com/auth/revoke and then deletes the row. If Apple fails, the error is logged and the deletion continues: our data is deleted anyway. To check it (MT-09): after deleting the account, the Apple ID settings no longer list MaihueGO.

Server-to-server notifications

Apple calls POST /api/v3/auth/oauth/apple/notifications, configured as the Server-to-Server Notification Endpoint on each environment’s primary App ID. The endpoint is public and verifies the JWS against Apple’s public keys (issuer https://appleid.apple.com, audience within APPLE_CLIENT_IDS). An invalid JWS answers 400 before any rate-limit budget is spent.
  • An event for an Apple user without a login here is acknowledged and ignored, so Apple does not retry it.
  • The auth_provider_notification table keeps the last applied event per Apple identifier and group (consent or email). An event whose time is not newer than the last applied one is ignored: a retried old email-enabled never undoes a newer email-disabled, and the same JWS posted twice does nothing. If the effect fails, the record goes back to the event applied before it (or is removed when there was none), so Apple’s retry applies it and an older event still cannot undo a newer one.
  • Limit: 20 per 10 minutes per Apple identifier, never per IP.

Hidden e-mail (Private Email Relay)

With “Hide My Email”, the @privaterelay.appleid.com address becomes the login e-mail and user_metadata.is_private_email is set to true (from the identity token’s is_private_email claim). Support uses it to explain why an e-mail looks random. For those e-mails to arrive, the sending domains and addresses (Resend, its return-path domain and each Supabase project’s SMTP sender) must be registered in Sign in with Apple for Email Communication. Apple only accepts a domain whose SPF passes. See Rollout. If that person later declares a document that already has an account, they can link their login to that account instead of creating another one (see Identity linking).

The name, only the first time

If Apple sends the name (first authorization), it is used. If it does not and the profile has no name, the response carries needs_name and the client asks for it: “Confirma tus datos” in the app, auth/oauth/welcome on the web. An existing name is never replaced.
Pending: spike T-01. It is not yet confirmed that Supabase returns Apple’s provider_refresh_token in the browser flow. If it does not, Apple logins created on Android and the web have no stored token and cannot be revoked by token on account deletion: revocation is limited to what Apple’s notifications allow, although our data is deleted anyway. On iOS (native) the token always comes from the code exchange.

See also