Skip to main content
lakshmir9003361
New Participant
Jul 13, 2021 2:31 PM UTC
Question

Generate JWT token for AEP without Adobe I/O

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

Level 4
Oct 19, 2021 3:32 AM UTC
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;
});
Translate
Employee
Jul 27, 2021 3:57 PM UTC

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

 

Translate