JWT Generator Function

 

var jwt = require('jsonwebtoken');
var fs = require('fs-extra');
var cert = fs.readFileSync(process.cwd() + '/privatekey_rsa.pem');

//Client ID is your API key.
function getClientAssertion(clientId) {
    var myToken = jwt.sign({
        "iss": clientId
    }, cert, {algorithm: "RS256", "expiresIn": "1h"});

    console.log(myToken);
    return myToken;
}

Return to previous page.