Generate JWT token for AEP without Adobe I/O | Community
Skip to main content
lakshmir9003361
July 13, 2021
Question

Generate JWT token for AEP without Adobe I/O

  • July 13, 2021
  • 2 replies
  • 1369 views

Hi,

 

Can anyone help me to understand if we can generate JWT token without using Adobe I/O.

If possible what is the API link and the parameters required to be passed.

If there is any document that could help

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Adobe Employee
July 27, 2021

Here is our official JWT documentation which also includes sample code for JWT generation

https://www.adobe.io/authentication/auth-methods.html#!AdobeDocs/adobeio-auth/master/JWT/JWT.md

 

Level 4
October 19, 2021
1. Make sure the your certificate key fingerprint is added 

 

Example node.js for generating the JWT
 
'use strict';

const fs = require('fs');
const jwt = require('jsonwebtoken');
var expiry =  Date.now() + 86400000 ;

var jwtPayload = {
    "exp":expiry,
    "iss":"<org id>",
    "sub":"<email>",
    "https://ims-na1.adobelogin.com/s/ent_audiencemanagerplatform_sdk":true,
    "aud":"https://ims-na1.adobelogin.com/c/890bbe...."
};
var privateKey = fs.readFileSync("../aam-api/secret.pem");

jwt.sign(jwtPayload, privateKey, { algorithm: 'RS256' }, function(err, token) {
    console.log(token);
    return token;
});