Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dylanyoung-dev/5a5fa46dc5106ef7caebd8265aeeb85d to your computer and use it in GitHub Desktop.
Save dylanyoung-dev/5a5fa46dc5106ef7caebd8265aeeb85d to your computer and use it in GitHub Desktop.
How to use Client Credentials grant type with Sitecore CDP/Personalize.
{
"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