Tools / App Store Connect API JWT Generator

App Store Connect API JWT Generator.

Sign an ES256 JWT for the App Store Connect API or App Store Server API with your .p8 key, in the browser.

Runs in your browser

App Store Connect API tokens live up to 20 minutes; App Store Server API tokens up to 60 minutes and carry your bundle ID.

Individual keys have no issuer ID and use sub = user. App Store Server API keys are always team keys.

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
JWT
Claims
Header
Payload
Example request

About App Store Connect API JWT Generator

Every call to the App Store Connect API and the App Store Server API needs a short-lived JSON Web Token in the Authorization header, signed with ES256 using the private key you downloaded from App Store Connect as AuthKey_KEYID.p8. Writing that token by hand is where most people get stuck: the header needs alg ES256, your key ID as kid and typ JWT; the payload needs your issuer ID as iss, iat and exp in seconds, and aud set to appstoreconnect-v1. This generator fills all of that in and signs the token in your browser with WebCrypto. Pick the API, paste the issuer ID, key ID and the contents of the .p8 file, and you get a token ready for curl or Postman, the decoded header and payload, the issue and expiry times, and a sample request. For the App Store Server API it adds the bid claim with your bundle ID; for individual keys it uses sub = user instead of an issuer. Typical mistakes it prevents: setting exp more than 20 minutes ahead (60 for the Server API), which Apple answers with 401 NOT_AUTHORIZED; using milliseconds instead of seconds; and producing a DER-encoded ECDSA signature, which some crypto libraries do by default but JWS forbids. Here the signature is the raw 64-byte r||s value, and the token is verified against the public half of your key before it is shown. The private key is never uploaded, stored or put in the page URL, but treat the page like any place you paste a secret and close it when done.

How to Use

  1. Choose the API and key type, then enter your issuer ID, key ID and (for the Server API) bundle ID.
  2. Paste the full contents of your AuthKey_XXXXXXXXXX.p8 file.
  3. Copy the JWT and send it as "Authorization: Bearer <token>" before it expires.

Frequently Asked Questions

Is my private key sent to your server?

No. The token is signed in your browser with the WebCrypto API. The page makes no network requests with your key and does not save it in history or in the URL.

Why does Apple return 401 NOT_AUTHORIZED?

Usually the token expired or exp is too far ahead (over 20 minutes for App Store Connect, 60 for the App Store Server API), the key ID and issuer ID do not belong together, or the key was revoked. Generate a fresh token and check the IDs in Users and Access → Integrations.

What is the scope field for?

App Store Connect tokens can optionally be limited to specific requests, such as "GET /v1/apps?filter[platform]=IOS". Leave it empty for a token that works for every endpoint the key's role allows.

Can I use this token for the App Store Server API?

Yes, choose app-store-server. The token then includes your bundle ID as bid and may live up to 60 minutes. Use a key created under In-App Purchase keys.

Related Tools