I'm trying to generate a JWT token for Apple Connect but It's look like something is missing in the "Verify signature" field.
Issue : - I do have the "Invalid Signature" message displaying ... - I don't have any idea where to find the "Public key or cerficate"
I'm following these docs : - https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests - https://medium.com/xcblog/generating-jwt-tokens-for-app-store-connect-api-2b2693812a35
Do you have any idea how to fix find the "Public key"?
Thank you for your help,
Use the private key associated with the key ID you specified in the header to sign the token. Regardless of the programming language you’re using with the App Store Connect API, there are a variety of open source libraries available online for creating and signing JWT tokens.
If you have more than one API key, use the key ID of the same private key that you use to sign the JWT. Here’s an example of a JWT header: The JWT payload contains information specific to the App Store Connect APIs, such as issuer ID and expiration time. Use the following fields and values in the JWT payload:
JSON Web Tokens are JSON payloads encoded in Base64 and signed with your private key for their transmission to the App Store Connect API server. You can create your token with any text editor.
(Optional) To get your issuer ID, log in to App Store Connect and: Select Users and Access, then Select the API Keys tab. The issuer ID appears near the top of the page. To copy the issuer ID, click Copy next to the ID. Here’s an example of a JWT payload:
The .p8 file includes the private and public keys. You need to extract those using OpenSSL.
To get the private key:
$ openssl ec -in AuthKey.p8 -out AuthKey_private.p8
To get the public key:
$ openssl ec -in AuthKey.p8 -pubout -out AuthKey_public.p8
Using keys generated via these commands got the signature verified on jwt.io.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With