Sign in with Apple#
Lets people sign in with their Apple Account. The App Store expects an app that offers other third-party sign-in on iOS to offer Sign in with Apple too (App Review guideline 4.8), and leptoskit auth doctor reminds you. Last checked against Apple's documentation on 30 October 2026.
Set it up#
Run
leptoskit auth provider add apple. It adds:[auth.providers.apple] client_id_env = "APPLE_SERVICES_ID" team_id_env = "APPLE_TEAM_ID" key_id_env = "APPLE_KEY_ID" private_key_env = "APPLE_PRIVATE_KEY"In Certificates, Identifiers & Profiles, create a Services ID, turn on Sign in with Apple for it, and add your domain and the return URL
https://myapp.com/auth/callback/apple. Apple doesn't acceptlocalhost; test with a tunnel that gives you anhttpsaddress.Create a key with Sign in with Apple enabled, and download its
.p8file. Apple lets you download it once.Set
APPLE_SERVICES_ID(the Services ID),APPLE_TEAM_ID,APPLE_KEY_ID, andAPPLE_PRIVATE_KEY(the.p8file's contents) in your server's environment.Turn on the
auth-providersfeature, and runleptoskit auth doctor.
What sign-in gets#
A stable ID for the person and their email address, which Apple vouches for. It may be a private relay address that forwards to them, such as x7…@privaterelay.appleid.com. Apple sends the person's name only the first time they sign in, so leptoskit stores it then.
Apple doesn't take a fixed client secret: leptoskit signs a short one for each sign-in with your .p8 key, so there's nothing to rotate. Apple sends people back by posting a form from its own site; leptoskit answers that post with a page that posts it again from your site, where the sign-in's cookie is sent, and only then signs anyone in.
Platforms#
It works on the web, and in iOS, macOS, and Android apps through the system browser, with the same Return URLs: the browser comes back to your site, which sends it on to the app. On iPhone, iPad, and Mac, apps use Sign in with Apple's own sheet instead, which needs [native] package_id and the Sign in with Apple capability. See Sign-in for each platform.