From 9fe8deea64433aaeb268f9de3326d53f560a7151 Mon Sep 17 00:00:00 2001 From: TA2k Date: Sun, 10 Mar 2024 01:12:06 +0100 Subject: [PATCH] update skoda user agent --- main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 524419c..dadc4ef 100644 --- a/main.js +++ b/main.js @@ -38,6 +38,7 @@ class VwWeconnect extends utils.Adapter { this.json2iob = new Json2iob(this); this.jar = request.jar(); this.userAgent = "iobroker v"; + this.skodaUserAgent = "OneConnect/000000164 CFNetwork/1494.0.7 Darwin/23.4.0"; this.refreshTokenInterval = null; this.vwrefreshTokenInterval = null; this.updateInterval = null; @@ -1162,6 +1163,7 @@ class VwWeconnect extends utils.Adapter { // const jwtauth_code = hashArray[1].substring(hashArray[1].indexOf("=") + 1); // const jwtaccess_token = hashArray[2].substring(hashArray[2].indexOf("=") + 1); // const jwtid_token = hashArray[5].substring(hashArray[5].indexOf("=") + 1); + let method = "POST"; let body = "auth_code=" + jwtauth_code + "&id_token=" + jwtid_token; let url = "https://tokenrefreshservice.apps.emea.vwapps.io/exchangeAuthCode"; @@ -1200,7 +1202,7 @@ class VwWeconnect extends utils.Adapter { accept: "*/*", // authorization: "Bearer " + parsedParameters.id_token, "content-type": "application/json", - "user-agent": this.useragent, + "user-agent": this.skodaUserAgent, "accept-language": "de-de", }; } @@ -1855,7 +1857,7 @@ class VwWeconnect extends utils.Adapter { headers = { accept: "application/json", "content-type": "application/json;charset=utf-8", - "user-agent": this.userAgent, + "user-agent": this.skodaUserAgent, "accept-language": "de-de", authorization: "Bearer " + this.config.atoken, }; @@ -3358,7 +3360,7 @@ class VwWeconnect extends utils.Adapter { "api-key": "ok", accept: "application/json", "content-type": "application/json;charset=utf-8", - "user-agent": this.userAgent, + "user-agent": this.skodaUserAgent, "accept-language": "de-de", "If-None-Match": this.etags[url] || "", authorization: "Bearer " + this.config.atoken, @@ -3476,7 +3478,7 @@ class VwWeconnect extends utils.Adapter { "api-key": "ok", accept: "application/json", "content-type": "application/json;charset=utf-8", - "user-agent": this.userAgent, + "user-agent": this.skodaUserAgent, "accept-language": "de-de", authorization: "Bearer " + this.config.atoken, },