n8n-nodes-jygse-vw-weconnect 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -175,10 +175,11 @@ class VwWeConnect {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
exports.VwWeConnect = VwWeConnect;
|
|
178
|
-
// VW OAuth2 Configuration (Updated January 2026 -
|
|
179
|
-
|
|
178
|
+
// VW OAuth2 Configuration (Updated January 2026 - VW ID type from ioBroker.vw-connect)
|
|
179
|
+
// Note: This is for VW ID (newer vehicles like ID.3, ID.4, T6.1 with WeConnect)
|
|
180
|
+
const VW_CLIENT_ID = 'a24fba63-34b3-4d43-b181-942111e6bda8@apps_vw-dilab_com';
|
|
180
181
|
const VW_SCOPE = 'openid profile mbb email cars birthdate badge address vin';
|
|
181
|
-
const VW_REDIRECT_URI = '
|
|
182
|
+
const VW_REDIRECT_URI = 'weconnect://authenticated';
|
|
182
183
|
const VW_RESPONSE_TYPE = 'id_token token code';
|
|
183
184
|
// WeConnect App headers (from ioBroker.vw-connect v0.7.15)
|
|
184
185
|
const VW_USER_AGENT = 'Mozilla/5.0 (Linux; Android 14; SM-G960F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36';
|
|
@@ -215,18 +216,17 @@ async function vwLogin(context, email, password) {
|
|
|
215
216
|
const state = generateTraceId(); // Use UUID as state
|
|
216
217
|
const traceId = generateTraceId(); // For weconnect-trace-id header
|
|
217
218
|
const codeVerifier = generateCodeVerifier();
|
|
218
|
-
// Browser-like headers (from ioBroker.vw-connect
|
|
219
|
+
// Browser-like headers (EXACTLY from ioBroker.vw-connect)
|
|
219
220
|
const browserHeaders = {
|
|
220
221
|
'User-Agent': VW_USER_AGENT,
|
|
221
|
-
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/
|
|
222
|
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
|
|
222
223
|
'Accept-Language': VW_ACCEPT_LANGUAGE,
|
|
223
|
-
'Accept-Encoding': 'gzip, deflate
|
|
224
|
+
'Accept-Encoding': 'gzip, deflate',
|
|
224
225
|
'x-requested-with': VW_APP_PACKAGE,
|
|
225
226
|
'upgrade-insecure-requests': '1',
|
|
226
227
|
};
|
|
227
|
-
// Generate PKCE code challenge (required by VW identity)
|
|
228
|
-
const codeChallenge = generateCodeChallenge(codeVerifier);
|
|
229
228
|
// Step 1: Go directly to identity.vwgroup.io (like ioBroker adapter)
|
|
229
|
+
// Note: VW ID type does NOT use PKCE (code_challenge) - only VW v2 does
|
|
230
230
|
const authorizeUrl = 'https://identity.vwgroup.io/oidc/v1/authorize';
|
|
231
231
|
const authorizeParams = new URLSearchParams({
|
|
232
232
|
client_id: VW_CLIENT_ID,
|
|
@@ -235,8 +235,6 @@ async function vwLogin(context, email, password) {
|
|
|
235
235
|
redirect_uri: VW_REDIRECT_URI,
|
|
236
236
|
nonce: nonce,
|
|
237
237
|
state: state,
|
|
238
|
-
code_challenge: codeChallenge,
|
|
239
|
-
code_challenge_method: 'S256',
|
|
240
238
|
});
|
|
241
239
|
// Use browser-like headers for initial request
|
|
242
240
|
// Let n8n follow redirects automatically to reach the login page
|
package/package.json
CHANGED