sign-in-with-apple
Skill0 starsChanged 30 days agoMITView on GitHub
Sign in with Apple server-side reference for the apple plugin — generating the client secret JWT, verifying identity tokens against Apple's JWKS, exchanging authorization codes, refreshing and revoking tokens, private relay e-mails. Load when implementing or debugging Sign in with Apple (siwa_* tools).
In this repository15 other files it gives its agents.
- apnsSkill
- apple-business-managerSkill
- apple-mapsSkill
- apple-musicSkill
- apple-newsSkill
- apple-search-adsSkill
- apple-servicesSkill
- app-store-connectSkill
- app-store-serverSkill
- cloudkitSkill
- docsSkill
- icloudSkill
- setupSkill
- statusSkill
- weatherkitSkill
The file
Files
Sign in with Apple (tools siwa_*)
Config sign_in_with_apple: client_id (Services ID for web/Android, or the app bundle id for
native), team_id, key_id + .p8 (key enabled for Sign in with Apple, grouped under the
primary App ID).
Flows
- Client secret (
siwa_client_secret): ES256 JWTiss=team,sub=client_id,aud=https://appleid.apple.com, ≤ 180 days. Backends use it for/auth/tokenand/auth/revoke. - Verify an identity token (
siwa_verify_identity_token): fetcheshttps://appleid.apple.com/auth/keys, checks RS256 signature,iss,aud(= client_id oraudience),exp, optionalnonce. Claims:sub(stable user id per team),email,email_verified,is_private_email(relay address…@privaterelay.appleid.com),real_user_status(0 unsupported, 1 unknown, 2 likely real),auth_time,nonce_supported. The user's name is only delivered once, in the first authorization response (not in the token) — store it then. - Exchange / refresh (
siwa_token):code+redirect_uri(web) →access_token,refresh_token,id_token; laterrefresh_tokento validate the session (at most once a day per Apple's guidance).invalid_grant→ code already used, expired (5 min), wrong client_id/redirect. - Revoke (
siwa_revoke): required when the user deletes their account (App Store Review guideline 5.1.1(v)); afterwards the next sign-in behaves like a first sign-in. - Server-to-server notifications (user disabled e-mail forwarding, deleted the account…) are sent
as a signed JWT to the endpoint registered on the Services ID; decode with
apple_jws_decodeand verify like an identity token. - Private relay: to e-mail relay addresses, register your sender domains/addresses in Certificates, Identifiers & Profiles → Services → Sign in with Apple for Email Communication.
Docs: apple_docs_index technology=signinwithapplerestapi, sign_in_with_apple.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

