n8n-nodes-jygse-vw-weconnect 0.2.5 → 0.2.7
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,11 +175,11 @@ class VwWeConnect {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
exports.VwWeConnect = VwWeConnect;
|
|
178
|
-
// VW OAuth2 Configuration (Updated January 2026 - VW
|
|
179
|
-
// Note: This is for VW
|
|
180
|
-
const VW_CLIENT_ID = '
|
|
178
|
+
// VW OAuth2 Configuration (Updated January 2026 - VW v2/Carnet for T6.1 from ioBroker.vw-connect)
|
|
179
|
+
// Note: This is for VW v2 (older vehicles like T6.1 with Car-Net/We Connect Go)
|
|
180
|
+
const VW_CLIENT_ID = '9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com';
|
|
181
181
|
const VW_SCOPE = 'openid profile mbb email cars birthdate badge address vin';
|
|
182
|
-
const VW_REDIRECT_URI = '
|
|
182
|
+
const VW_REDIRECT_URI = 'carnet://identity-kit/login';
|
|
183
183
|
const VW_RESPONSE_TYPE = 'id_token token code';
|
|
184
184
|
// WeConnect App headers (from ioBroker.vw-connect v0.7.15)
|
|
185
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';
|
|
@@ -225,22 +225,25 @@ async function vwLogin(context, email, password) {
|
|
|
225
225
|
'x-requested-with': VW_APP_PACKAGE,
|
|
226
226
|
'upgrade-insecure-requests': '1',
|
|
227
227
|
};
|
|
228
|
+
// Generate PKCE code challenge (required by VW v2/Carnet)
|
|
229
|
+
const codeChallenge = generateCodeChallenge(codeVerifier);
|
|
228
230
|
// Step 1: Go directly to identity.vwgroup.io (like ioBroker adapter)
|
|
229
|
-
// Note: VW
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
client_id
|
|
233
|
-
scope
|
|
234
|
-
response_type
|
|
235
|
-
redirect_uri
|
|
236
|
-
nonce
|
|
237
|
-
state
|
|
238
|
-
|
|
231
|
+
// Note: VW v2 (T6.1, etc.) uses PKCE with S256
|
|
232
|
+
// Build URL manually like ioBroker does (pre-encoded values)
|
|
233
|
+
const authorizeUrl = 'https://identity.vwgroup.io/oidc/v1/authorize' +
|
|
234
|
+
'?client_id=' + encodeURIComponent(VW_CLIENT_ID) +
|
|
235
|
+
'&scope=' + encodeURIComponent(VW_SCOPE) +
|
|
236
|
+
'&response_type=' + encodeURIComponent(VW_RESPONSE_TYPE) +
|
|
237
|
+
'&redirect_uri=' + encodeURIComponent(VW_REDIRECT_URI) +
|
|
238
|
+
'&nonce=' + nonce +
|
|
239
|
+
'&state=' + state +
|
|
240
|
+
'&code_challenge=' + codeChallenge +
|
|
241
|
+
'&code_challenge_method=S256';
|
|
239
242
|
// Use browser-like headers for initial request
|
|
240
243
|
// Let n8n follow redirects automatically to reach the login page
|
|
241
244
|
const authorizeResponse = await context.helpers.httpRequest({
|
|
242
245
|
method: 'GET',
|
|
243
|
-
url:
|
|
246
|
+
url: authorizeUrl,
|
|
244
247
|
headers: browserHeaders,
|
|
245
248
|
encoding: 'text',
|
|
246
249
|
returnFullResponse: true,
|
package/package.json
CHANGED