AEM Cloud Service - Get Adobe IMS JWT and AEM Access Token using POSTMan for SSO | AEM Community Blog Seeding | Community
Skip to main content
kautuk_sahni
Community Manager
Community Manager
July 28, 2021

AEM Cloud Service - Get Adobe IMS JWT and AEM Access Token using POSTMan for SSO | AEM Community Blog Seeding

  • July 28, 2021
  • 3 replies
  • 1961 views

BlogImage.jpg

AEM Cloud Service - Get Adobe IMS JWT and AEM Access Token using POSTMan for SSO by Sreekanth Choudry Nalabotu

Abstract

Goal
This article is on using POSTMan requests to generate a long lived signed JWT token and exchange it with Adobe IMS for an IMS Access Token, valid for 24 hours. Using the access token you can make SSO requests to AEM sending the token in Authorization header. Check AEM documentation

var navigator = {};
var window = {};
var PRIVATE_KEY = "-----BEGIN RSA PRIVATE KEY-----\r\nMIIECvfNI=\r\n-----END RSA PRIVATE KEY-----\r\n"
var CLIENT_ID = "cm-pxxxx-exxxxx-integration";
var ORG_ID = "2Fxxxxxxx@AdobeOrg";
var SUBJECT = "31xxxxxx@techacct.adobe.com";
var META_SCOPE = "https://ims-na1.adobelogin.com/s/ent_aem_cloud_api";

pm.sendRequest('http://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js', (error, response) => {
if (error) {
console.log(error);
} else {
let resBody = new Buffer.from(response.stream).toString()

pm.globals.set("jsrsasign-js", resBody);

eval(pm.globals.get("jsrsasign-js"));

var jwt_payload = {
iss: ORG_ID,
sub: SUBJECT,
exp: Math.floor((Date.now() / 1000) + 3600 * 8),
aud: "https://ims-na1.adobelogin.com/c/" + CLIENT_ID,
META_SCOPE : true
}

var jwtToken = KJUR.jws.JWS.sign("RS256", '{"alg" : "RS256","typ" : "JWT"}', jwt_payload, PRIVATE_KEY);

postman.setEnvironmentVariable("jwt-token", jwtToken);
}
});

Read Full Blog

AEM Cloud Service - Get Adobe IMS JWT and AEM Access Token using POSTMan for SSO

Q&A

Please use this thread to ask the related questions.

3 replies

Level 2
September 22, 2022

Thanks for sharing, I can get the access token via postman.

I have one question, Do you have any document to generate the access token by Java or something like that. I very much appreciate you.

Thank you

Level 2
November 24, 2023

Great Information!.
I can able to generate access token using service credentials. But the last step, the user account related to the technical account is not showing in the author environment. what could be the reason this. Please suggest.

Level 2
September 17, 2025

Hi @kautuk_sahni 

I was trying to generate JWT token by following above mentioned steps via postman but getting below error, any help would be appreciated.

{
    "error": "bad_request",
    "error_description": "missing jwt_token parameter"
}
 
Please let me know anything.
 
Level 2
September 17, 2025

Hi @srikanth23696837zrx0,

 

The error message indicates that Authorization token is missing. As mentioned in that article, you have to add the generated JWT Token in the Header section. Please recheck one more time