What goes in the client secret
The client secret is a JWT with two JSON parts and a signature. Apple's page names every field. Common mistakes: the Team ID in kid, the Team ID in front of the client ID, the bundle ID where the Services ID belongs, or an expiry past six months.
| Field | What goes in | Example |
|---|---|---|
alg (header) | Always ES256 | ES256 |
kid (header) | Your Key ID, 10 characters | ABC123DEFG |
iss | Your Team ID, 10 characters | DEF123GHIJ |
iat | When you made it, in seconds since 1 January 1970 UTC | 1796428800 |
exp | When it expires: at most 15,777,000 seconds (six months) after now, by Apple's clock | 1811980800 |
aud | Always https://appleid.apple.com | https://appleid.apple.com |
sub | The same Services ID or bundle ID you send as client_id. Case-sensitive | com.example.web |
It's signed with ECDSA on the P-256 curve with SHA-256, using the .p8 key you made with Sign in with Apple ticked. The signature is the raw 64 bytes, not the DER form some crypto libraries write by default.
Sources, checked 5 December 2026: Apple's Creating a client secret, Generate and validate tokens, Revoke tokens, ErrorResponse, Revoke, edit, and download keys, Create a Sign in with Apple private key and Offering account deletion in your app; Supabase's Login with Apple; Firebase's Authenticate Using Apple with JavaScript.
Where to paste it
| Where | Field | Notes |
|---|---|---|
| Supabase | Authentication, Apple provider, Secret Key (for OAuth) | If the project also uses native Sign in with Apple, put the Services ID first in Client IDs. Supabase says native-only sign-in doesn't need the secret. |
| Firebase | No secret to paste | Firebase asks for your Team ID, the Key ID and the private key itself, in the OAuth code flow configuration section. |
| Your own server | client_secret on /auth/token and /auth/revoke | Send client_id with the same value as sub, as a form post. |
The six-month problem
The secret has an end date built in. The key you sign it with doesn't have to change. Up to six months after you make a secret, it runs out, and every sign-in that sends it starts failing with invalid_client. Supabase's docs call rotating it "a critical maintenance task that will cause authentication failures if missed." The fix takes a minute, but only if someone remembers.
- Keep the .p8 file somewhere safe. Apple won't let you download it again.
- Save the reminder. The Add a renewal reminder button gives you a calendar file for the day before the secret expires, with an alert six days earlier.
- On that day, make a new secret here with the same key and IDs, and replace the old one wherever it's saved.
- Paste the old one into the checker if you're not sure when it runs out.
Revoking tokens when someone deletes their account
Apple asks apps that offer Sign in with Apple to revoke a person's tokens through the REST API when they delete their account. The generator writes the curl command for that with your new secret in it. Your server needs the refresh token it saved when the person first signed in. Firebase doesn't keep that token, so its docs say to ask the person to sign in again before you revoke and delete. Our account deletion requirements checker lists the rest of what Apple and Google ask for.
Where Hailbell fits
When a secret expires, the first sign of it is often a message from someone who can't log in. Hailbell puts a support chat in your iOS, Android or web app, and messages reach you in Discord, Telegram, Slack or the web dashboard, so a message saying sign-in is broken reaches you where you already are. Hailbell has a 14-day free trial, no card needed. See how it works.
Questions
What is the Apple client secret?
It's a short-lived JWT your server sends as client_secret when it swaps a Sign in with Apple code for tokens, refreshes them or revokes them. Apple doesn't give you a fixed secret like other sign-in providers. You make one yourself: a header with alg ES256 and your Key ID, claims with your Team ID, the time, the expiry, https://appleid.apple.com and your client ID, all signed with the .p8 key from your developer account.
How long does an Apple client secret last?
At most 15,777,000 seconds, about six months. Apple says it's an error to ask for an expiry further out than that, measured by the clock on Apple's servers, so this generator stops at 182 days and fills in 180. When it runs out, Apple answers invalid_client and Sign in with Apple stops working until you paste a new one. Nothing warns you beforehand, so save the reminder this page makes.
Do I need a new .p8 key when the secret expires?
No. Sign a new secret with the same .p8 key. You need a new key only if you lost the file, since Apple lets you download it once, or if you think it leaked. For a leak, Apple says to create a new key for the same primary App ID first, move to it, then revoke the old one.
Which client ID goes in sub: the Services ID or the bundle ID?
The same one you send as client_id. For sign-in on a website, on Android or through Supabase's OAuth flow, that's your Services ID, like com.example.web. For tokens that came from Sign in with Apple in your iPhone app, it's the app's bundle ID. Apple says the value is case-sensitive and must not include your Team ID.
Is it safe to put my .p8 key in this page?
The page reads the key with your browser's Web Crypto and signs the secret in the same tab. No request carries the key, the page doesn't save it, and it's gone when you close the tab or press Start over. You can watch the Network tab in your browser's developer tools while you use it. If your company doesn't allow keys in a browser at all, the table above has every field, so you can sign the same JWT in your own code.
How do I test an Apple client secret?
Apple has no endpoint that only checks a secret. A request to /auth/token with a made-up code often comes back invalid_grant, even when the secret is broken. We sent one with the secret set to the word garbage on 5 December 2026 and got invalid_grant too, so that answer doesn't prove the secret works. The real test is a real sign-in. If the secret, the client ID or the key is wrong, Apple's token endpoint answers invalid_client. The checker on this page catches the usual mistakes before that: wrong aud, the same code in kid and iss, a Team ID in front of the client ID, an expiry past six months, an expired secret, or a signature that doesn't match the key it names.
More free tools for app developers: all free tools. Questions about support in your app? Start a chat with us.