I am still not able to create a valid token using everything right
still not able to figure out wats wrong!!
const OpenSSL = require('openssl-nodejs')
const fs = require('fs');
const path = require('path');
var jwt = require('jsonwebtoken');
var http = require('http')
function getToken() {
const now = Math.round(new Date().getTime() / 1000);
const expirationTime = now + 1999;
const privateKey = fs.readFileSync('./AuthKey_W467528DJL.p8')
const headers = {
algorithm: 'ES256',
header: {
alg: 'ES256',
kid: 'W467528DJL',
typ: 'JWT',
},
};
let payload = {
iss: '8b3af5d2-f293-452c-8df1-6d023149279b',
exp: expirationTime,
aud: 'appstoreconnect-v1',
bid: 'org.momly.app'
}
const token = jwt.sign(payload, privateKey, {
algorithm: 'ES256',
header: {
alg: 'ES256',
kid: 'W467528DJL',
typ: 'JWT',
}
});
console.log("token ---> " + token);
const verify = jwt.verify(token, privateKey)
console.log("Verify", verify)
};
getToken()
please provide help to how to get a valid token
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags: