I am trying to make an api call using a JWT token generated using App store connect api key.
The token is rejected with the following error:
"errors": [
{
"status": "401",
"code": "NOT_AUTHORIZED",
"title": "Authentication credentials are missing or invalid.",
"detail": "Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens"
}
]
My header and payload are as follow:
Header
{
"alg": "ES256",
"kid": "<MY_KEY_ID>",
"typ": "JWT"
}
Payload
{
"iss": "<MY_ISSUER_ID>",
"aud": "appstoreconnect-v1",
"iat": 1698333493,
"exp": 1698333793
}
I am unable to find what is wrong with my token. Can someone help me with this?