Hi there! Thanks for this great threads of questions/answers.
Not sure if that’s possible, but I’m getting stuck on GAS with ECDSA signature because there is no native library… I’m using HMAC but Token remains false.
var header = {
"alg": "ES256",
"kid": "private",
"typ": "JWT"
};
var encodedHeader = Utilities.base64EncodeWebSafe(JSON.stringify(header));
var data = {
"iss": "private",
"exp": 1580425545,
"aud": "appstoreconnect-v1"
};
var encodedData = Utilities.base64EncodeWebSafe(JSON.stringify(data));
var token = encodedHeader + "." + encodedData;
var secret = "private key"
var signature = Utilities.computeHmacSha256Signature(token, secret);
signature = Utilities.base64EncodeWebSafe(signature);
var signedToken = token + "." + signature;
Thanks!