Adobe  I/O JWT for Node.js Apps

Creating a JWT for a Node.js App

This example illustrates how to create a JSON Web Token for a node.js application using the library jwt-simple.

var fs = require('fs');
var jwt = require('./node_modules/jwt-simple');

var AdobeConfig = {
    payload: {
        'exp': Math.round(87000 +,
        'iss': '…@AdobeOrg',
        'sub': '…',
        'aud': '…,
        '': true
    clientid: 'API key here',
    clientsecret: 'client secret here',
    pem: '',
    algorithm: 'RS256'
AdobeConfig.pem = fs.readFileSync('./certificate/private-key.pem').toString('ascii');
var token = jwt.encode(AdobeConfig.payload, AdobeConfig.pem, AdobeConfig.algorithm);