Created
April 25, 2024 15:46
-
-
Save cfjedimaster/322b303013e384cc539d813ef06fb450 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getAccessToken(id, secret) { | |
const params = new URLSearchParams(); | |
params.append('grant_type', 'client_credentials'); | |
params.append('client_id', id); | |
params.append('client_secret', secret); | |
params.append('scope', 'openid,AdobeID,session,additional_info,read_organizations,firefly_api,ff_apis'); | |
let resp = await fetch('https://ims-na1.adobelogin.com/ims/token/v3', | |
{ | |
method: 'POST', | |
body: params | |
} | |
); | |
let data = await resp.json(); | |
return data.access_token; | |
} | |
let token = await getAccessToken(CLIENT_ID, CLIENT_SECRET); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment