Skip to content

Instantly share code, notes, and snippets.

@sandermvanvliet
Last active December 25, 2020 09:40
Show Gist options
  • Save sandermvanvliet/f97a916ba43b676948d27574373a2c86 to your computer and use it in GitHub Desktop.
Save sandermvanvliet/f97a916ba43b676948d27574373a2c86 to your computer and use it in GitHub Desktop.
{
"info": {
"_postman_id": "16236cd9-63ed-4d5e-805b-5d25781090b0",
"name": "Audi Authentication",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Auth - 1 - Get OpenID configuration",
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://app-api.live-my.audi.com/myaudiappidk/v1/openid-configuration",
"protocol": "https",
"host": [
"app-api",
"live-my",
"audi",
"com"
],
"path": [
"myaudiappidk",
"v1",
"openid-configuration"
]
}
},
"response": []
},
{
"name": "Auth - 2 - Get authorization code",
"event": [
{
"listen": "test",
"script": {
"id": "9ffbc1a8-33cf-4f57-b505-6a3e2536142b",
"exec": [
"const location = pm.response.headers.get(\"Location\");\r",
"\r",
"pm.environment.set(\"signin-location\", location);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://identity.vwgroup.io/oidc/v1/authorize?response_type=code&client_id=09b6cbec-cd19-4589-82fd-363dfa8c24da%40apps_vw-dilab_com&redirect_uri=myaudi%3A%2F%2F%2F&scope=address%20profile%20badge%20birthdate%20birthplace%20nationalIdentifier%20nationality%20profession%20email%20vin%20phone%20nickname%20name%20picture%20mbb%20gallery%20openid&state=7f8260b5-682f-4db8-b171-50a5189a1c08&nonce=583b9af2-7799-4c72-9cb0-e6c0f42b87b3&prompt=login&ui_locales=nl-NL%20nl",
"protocol": "https",
"host": [
"identity",
"vwgroup",
"io"
],
"path": [
"oidc",
"v1",
"authorize"
],
"query": [
{
"key": "response_type",
"value": "code"
},
{
"key": "client_id",
"value": "09b6cbec-cd19-4589-82fd-363dfa8c24da%40apps_vw-dilab_com"
},
{
"key": "redirect_uri",
"value": "myaudi%3A%2F%2F%2F"
},
{
"key": "scope",
"value": "address%20profile%20badge%20birthdate%20birthplace%20nationalIdentifier%20nationality%20profession%20email%20vin%20phone%20nickname%20name%20picture%20mbb%20gallery%20openid"
},
{
"key": "state",
"value": "7f8260b5-682f-4db8-b171-50a5189a1c08"
},
{
"key": "nonce",
"value": "583b9af2-7799-4c72-9cb0-e6c0f42b87b3"
},
{
"key": "prompt",
"value": "login"
},
{
"key": "ui_locales",
"value": "nl-NL%20nl"
}
]
}
},
"response": []
},
{
"name": "Auth - 3 - Start sign-in process",
"event": [
{
"listen": "test",
"script": {
"id": "00f82819-e1df-4ce3-8a5f-38771bb63145",
"exec": [
"var body = pm.response.text();\r",
"\r",
"let csrfRegex = /name=\"_csrf\" value=\"([a-z0-9\\-]*)\"/gm;\r",
"let matches = csrfRegex.exec(body);\r",
"if(matches !== null)\r",
"{\r",
" pm.environment.set(\"csrf\", matches[1]);\r",
"}\r",
"\r",
"let relayStateRegex = /name=\"relayState\" value=\"([a-z0-9\\-]*)\"/gm;\r",
"matches = relayStateRegex.exec(body);\r",
"if(matches !== null)\r",
"{\r",
" pm.environment.set(\"relayState\", matches[1]);\r",
"}\r",
"\r",
"let hmacRegex = /name=\"hmac\" value=\"([a-z0-9\\-]*)\"/gm;\r",
"matches = hmacRegex.exec(body);\r",
"if(matches !== null)\r",
"{\r",
" pm.environment.set(\"hmac\", matches[1]);\r",
"}"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{signin-location}}",
"host": [
"{{signin-location}}"
]
}
},
"response": []
},
{
"name": "Auth - 4 - Sign-in process: username",
"event": [
{
"listen": "test",
"script": {
"id": "522fa00d-b070-4264-9f5d-72d9acdf6f4f",
"exec": [
"const location = pm.response.headers.get(\"Location\");\r",
"\r",
"pm.environment.set(\"signin-password\", location);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "POST",
"header": [
{
"key": "Referer",
"value": "https://identity.vwgroup.io/signin-service/v1/signin/09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com?relayState=1306273173f6e83fc92191ebf1b44c69cbaab41f",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "_csrf",
"value": "{{csrf}}",
"description": "This is coming out of the HTML response of sign-in start",
"type": "text"
},
{
"key": "relayState",
"value": "{{relayState}}",
"description": "This is coming out of the HTML response of sign-in start",
"type": "text"
},
{
"key": "hmac",
"value": "{{hmac}}",
"description": "This is coming out of the HTML response of sign-in start",
"type": "text"
},
{
"key": "email",
"value": "{{username}}",
"type": "text"
}
]
},
"url": {
"raw": "https://identity.vwgroup.io/signin-service/v1/09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com/login/identifier",
"protocol": "https",
"host": [
"identity",
"vwgroup",
"io"
],
"path": [
"signin-service",
"v1",
"09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com",
"login",
"identifier"
]
}
},
"response": []
},
{
"name": "Auth - 4 - Sign-in process: password page",
"event": [
{
"listen": "test",
"script": {
"id": "fb8be5cc-074d-4792-95bb-2f4b0e53edee",
"exec": [
"var body = pm.response.text();\r",
"\r",
"let csrfRegex = /name=\"_csrf\" value=\"([a-z0-9\\-]*)\"/gm;\r",
"let matches = csrfRegex.exec(body);\r",
"if(matches !== null)\r",
"{\r",
" pm.environment.set(\"csrf\", matches[1]);\r",
"}\r",
"\r",
"let relayStateRegex = /name=\"relayState\" value=\"([a-z0-9\\-]*)\"/gm;\r",
"matches = relayStateRegex.exec(body);\r",
"if(matches !== null)\r",
"{\r",
" pm.environment.set(\"relayState\", matches[1]);\r",
"}\r",
"\r",
"let hmacRegex = /name=\"hmac\" value=\"([a-z0-9\\-]*)\"/gm;\r",
"matches = hmacRegex.exec(body);\r",
"if(matches !== null)\r",
"{\r",
" pm.environment.set(\"hmac\", matches[1]);\r",
"}"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "GET",
"header": [
{
"key": "Referer",
"value": "https://identity.vwgroup.io/signin-service/v1/signin/09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com?relayState=1306273173f6e83fc92191ebf1b44c69cbaab41f",
"type": "text"
}
],
"url": {
"raw": "https://identity.vwgroup.io{{signin-password}}",
"protocol": "https",
"host": [
"identity",
"vwgroup",
"io{{signin-password}}"
]
}
},
"response": []
},
{
"name": "Auth - 5 - Sign-in process: password",
"event": [
{
"listen": "test",
"script": {
"id": "1c23a9e9-bcd1-496b-a42e-cb362d7314b2",
"exec": [
"const location = pm.response.headers.get(\"Location\");\r",
"\r",
"pm.environment.set(\"signin-continue\", location);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "POST",
"header": [
{
"key": "Referer",
"type": "text",
"value": "https://identity.vwgroup.io/signin-service/v1/signin/09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com?relayState=1306273173f6e83fc92191ebf1b44c69cbaab41f"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "_csrf",
"value": "{{csrf}}",
"type": "text"
},
{
"key": "relayState",
"value": "{{relayState}}",
"type": "text"
},
{
"key": "email",
"value": "{{username}}",
"type": "text"
},
{
"key": "hmac",
"value": "{{hmac}}",
"type": "text"
},
{
"key": "password",
"value": "{{password}}",
"type": "text"
}
]
},
"url": {
"raw": "https://identity.vwgroup.io/signin-service/v1/09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com/login/authenticate",
"protocol": "https",
"host": [
"identity",
"vwgroup",
"io"
],
"path": [
"signin-service",
"v1",
"09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com",
"login",
"authenticate"
]
}
},
"response": []
},
{
"name": "Auth - 6 - Sign-in process: continue",
"event": [
{
"listen": "test",
"script": {
"id": "27430774-0446-4c65-ae6a-18a05a2044b6",
"exec": [
"const location = pm.response.headers.get(\"Location\");\r",
"\r",
"pm.environment.set(\"signin-consent\", location);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "GET",
"header": [
{
"key": "Referer",
"type": "text",
"value": "https://identity.vwgroup.io/signin-service/v1/signin/09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com?relayState=1306273173f6e83fc92191ebf1b44c69cbaab41f"
}
],
"url": {
"raw": "{{signin-continue}}",
"host": [
"{{signin-continue}}"
]
}
},
"response": []
},
{
"name": "Auth - 7 - Sign-in process: consent",
"event": [
{
"listen": "test",
"script": {
"id": "3dfab843-fe1e-4c92-9677-75794a68214f",
"exec": [
"const location = pm.response.headers.get(\"Location\");\r",
"\r",
"if(location.startsWith('myaudi'))\r",
"{\r",
" const location = pm.response.headers.get(\"Location\");\r",
"\r",
" const regex = /code=(.*)$/gm;\r",
"\r",
" let matches = regex.exec(location);\r",
"\r",
" pm.environment.set('authorization-code', matches[1]);\r",
"}\r",
"else\r",
"{\r",
" pm.environment.set(\"signin-callback\", location);\r",
"}"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "GET",
"header": [
{
"key": "Referer",
"type": "text",
"value": "https://identity.vwgroup.io/signin-service/v1/signin/09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com?relayState=1306273173f6e83fc92191ebf1b44c69cbaab41f"
}
],
"url": {
"raw": "{{signin-consent}}",
"host": [
"{{signin-consent}}"
]
}
},
"response": []
},
{
"name": "Auth - 8 - Sign-in process: callback",
"event": [
{
"listen": "test",
"script": {
"id": "0f236841-a446-47b3-bf61-a4b7a716a32a",
"exec": [
"const location = pm.response.headers.get(\"Location\");\r",
"\r",
"const regex = /code=(.*)$/gm;\r",
"\r",
"let matches = regex.exec(location);\r",
"\r",
"pm.environment.set('authorization-code', matches[1]);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "GET",
"header": [
{
"key": "Referer",
"type": "text",
"value": "https://identity.vwgroup.io/signin-service/v1/signin/09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com?relayState=1306273173f6e83fc92191ebf1b44c69cbaab41f"
}
],
"url": {
"raw": "{{signin-callback}}",
"host": [
"{{signin-callback}}"
]
}
},
"response": []
},
{
"name": "Auth - 9 - Get token",
"event": [
{
"listen": "test",
"script": {
"id": "f4135712-3e9d-4bb4-9ede-ad754895f16d",
"exec": [
"const { access_token, refresh_token, id_token } = pm.response.json();\r",
"\r",
"pm.environment.set('audi_access_token', access_token);\r",
"pm.environment.set('audi_refresh_token', refresh_token);\r",
"pm.environment.set('audi_id_token', id_token);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"followRedirects": false
},
"request": {
"method": "POST",
"header": [
{
"key": "Referer",
"type": "text",
"value": "https://identity.vwgroup.io/signin-service/v1/signin/09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com?relayState=1306273173f6e83fc92191ebf1b44c69cbaab41f"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "client_id",
"value": "09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com",
"type": "text"
},
{
"key": "grant_type",
"value": "authorization_code",
"type": "text"
},
{
"key": "code",
"value": "{{authorization-code}}",
"type": "text"
},
{
"key": "redirect_uri",
"value": "myaudi:///",
"type": "text"
},
{
"key": "response_type",
"value": "token id_token",
"type": "text"
}
]
},
"url": {
"raw": "https://app-api.my.audi.com/myaudiappidk/v1/token",
"protocol": "https",
"host": [
"app-api",
"my",
"audi",
"com"
],
"path": [
"myaudiappidk",
"v1",
"token"
]
}
},
"response": []
},
{
"name": "Auth - Step 10 - Get VW API token",
"event": [
{
"listen": "test",
"script": {
"id": "16b57895-4297-4796-b056-a28fd2437c56",
"exec": [
"const { access_token, refresh_token } = pm.response.json();\r",
"\r",
"pm.environment.set('vw_access_token', access_token);\r",
"pm.environment.set('vw_refresh_token', refresh_token);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "X-App-Version",
"value": " 3.14.0",
"type": "text"
},
{
"key": "X-App-Name",
"value": " myAudi",
"type": "text"
},
{
"key": "X-Client-Id",
"value": " 77869e21-e30a-4a92-b016-48ab7d3db1d8",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "id_token",
"type": "text"
},
{
"key": "token",
"value": "{{audi_id_token}}",
"type": "text"
},
{
"key": "scope",
"value": "sc2:fal",
"type": "text"
}
],
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://mbboauth-1d.prd.ece.vwg-connect.com/mbbcoauth/mobile/oauth2/v1/token",
"protocol": "https",
"host": [
"mbboauth-1d",
"prd",
"ece",
"vwg-connect",
"com"
],
"path": [
"mbbcoauth",
"mobile",
"oauth2",
"v1",
"token"
]
}
},
"response": []
}
],
"protocolProfileBehavior": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment