I try to create an adobe access token in a headless action. first I tryed to use aio-lib-ims but this fails to include in the action (maybe an issue with the core library and their dependencies?)
is there any easy way to create an adobe access token having all data in the .env file?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Urs_Boller, @oliverf82757722 - a new version of @adobe/aio-lib-ims has been released, which fixes the issue reported earlier. I was able to get the token using this code.
const { context, getToken } = require('@adobe/aio-lib-ims')
const config = {
client_id: params.client_id,
client_secret: params.client_secret,
technical_account_email: params.technical_account_email,
technical_account_id: params.technical_account_id,
meta_scopes: [
'ent_campaign_sdk'
],
ims_org_id: params.ims_org_id,
private_key: params.private_key
};
await context.set('my_acs', config)
await context.setCurrent('my_acs')
// get JWT access token
const token = await getToken()
// initialize the sdk
const campaignClient = await CampaignStandard.init(params.tenant, params.client_id, token)
Please note that, for the value of private key, you could pass a string in this format: "-----BEGIN PRIVATE KEY-----\nmy\nprivate\nkey\n-----END PRIVATE KEY-----".
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi @Urs_Boller, @oliverf82757722 - a new version of @adobe/aio-lib-ims has been released, which fixes the issue reported earlier. I was able to get the token using this code.
const { context, getToken } = require('@adobe/aio-lib-ims')
const config = {
client_id: params.client_id,
client_secret: params.client_secret,
technical_account_email: params.technical_account_email,
technical_account_id: params.technical_account_id,
meta_scopes: [
'ent_campaign_sdk'
],
ims_org_id: params.ims_org_id,
private_key: params.private_key
};
await context.set('my_acs', config)
await context.setCurrent('my_acs')
// get JWT access token
const token = await getToken()
// initialize the sdk
const campaignClient = await CampaignStandard.init(params.tenant, params.client_id, token)
Please note that, for the value of private key, you could pass a string in this format: "-----BEGIN PRIVATE KEY-----\nmy\nprivate\nkey\n-----END PRIVATE KEY-----".
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies