Created
September 21, 2022 18:47
-
-
Save dylanyoung-dev/5a5fa46dc5106ef7caebd8265aeeb85d to your computer and use it in GitHub Desktop.
How to use Client Credentials grant type with Sitecore CDP/Personalize.
This file contains 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
{ | |
"info": { | |
"_postman_id": "e445a895-2163-4019-9770-7c53eddcf3e6", | |
"name": "Client Creds Authenticate", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", | |
"_exporter_id": "18869027" | |
}, | |
"item": [ | |
{ | |
"name": "Authenticate", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"exec": [ | |
"var jsonData = JSON.parse(responseBody);\r", | |
"postman.setEnvironmentVariable(\"AdminToken\", jsonData.access_token);" | |
], | |
"type": "text/javascript" | |
} | |
} | |
], | |
"request": { | |
"auth": { | |
"type": "basic", | |
"basic": [ | |
{ | |
"key": "username", | |
"value": "{{ClientKey}}", | |
"type": "string" | |
}, | |
{ | |
"key": "password", | |
"value": "{{ApiToken}}", | |
"type": "string" | |
} | |
] | |
}, | |
"method": "POST", | |
"header": [], | |
"body": { | |
"mode": "urlencoded", | |
"urlencoded": [ | |
{ | |
"key": "grant_type", | |
"value": "client_credentials", | |
"type": "text" | |
}, | |
{ | |
"key": "ClientKey", | |
"value": "{{ClientKey}}", | |
"type": "text" | |
} | |
] | |
}, | |
"url": { | |
"raw": "https://{{apiEndpoint}}/v2/oauth/token", | |
"protocol": "https", | |
"host": [ | |
"{{apiEndpoint}}" | |
], | |
"path": [ | |
"v2", | |
"oauth", | |
"token" | |
] | |
} | |
}, | |
"response": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment