Sign in with Apple Client Secret Generator.
Create the ES256 client_secret JWT for Sign in with Apple token requests from your .p8 key.
Runs in your browserAbout Sign in with Apple Client Secret Generator
Sign in with Apple does not give you a static client secret. Instead, every request to https://appleid.apple.com/auth/token, whether you exchange an authorization code, refresh a token or revoke one, must carry a client_secret that is a JWT you sign yourself with the private key from your Apple Developer account. The token header holds alg ES256 and your key ID; the payload holds your team ID as iss, the issue and expiry times, aud set to https://appleid.apple.com and your client ID as sub. For web sign-in the client ID is the Services ID; for a native app it is the bundle ID. This generator builds and signs that JWT in your browser. Enter the team ID, client ID, key ID and the contents of the .p8 file and choose how long it should live, up to Apple's limit of six months (15777000 seconds). You get the client_secret, the decoded header and payload, the exact expiry date to put in your calendar and a curl example of the token request. Common mistakes: using the App ID instead of the Services ID for web flows, which returns invalid_client; letting the secret expire unnoticed, which breaks every login at once; mixing up the team ID and the key ID; and signing with a DER-encoded signature from a generic crypto library. The signature produced here is the raw r||s form JWS requires, and it is checked against your key's public half before display. The key stays in your browser and is never stored or sent.
How to Use
- Enter your team ID, the Services ID (web) or bundle ID (native app) and the key ID.
- Paste the contents of the AuthKey_XXXXXXXXXX.p8 file for a key with Sign in with Apple enabled.
- Copy the client_secret into your server configuration and note the expiry date.
Frequently Asked Questions
How long can a client secret be valid?
At most 15777000 seconds, about six months. Many teams generate one with a shorter lifetime from a scheduled job so that an expired secret never breaks sign-in.
Why do I get invalid_client?
The client ID in the request does not match sub in the secret, the Services ID is not configured for the redirect URL, the key does not have Sign in with Apple enabled, or the secret expired. Regenerate it and compare client_id with sub.
Is my private key uploaded?
No. Signing uses the browser's WebCrypto API and the page makes no network requests with your key. It is not saved in history or in the URL.
Related Tools
Sign an ES256 JWT for the App Store Connect API or App Store Server API with your .p8 key, in the browser.
Decode, inspect, and verify JSON Web Tokens.
Check a deep link or Universal Link, build Android intent and adb/simctl test commands, and scan it as a QR code.
Encode and decode Base64 strings.
Generate MD5, SHA-256, SHA-512, and other hashes.
Generate apple-app-site-association and assetlinks.json, and validate the files your domain serves.