trocotronic/weconnect

Error code 302 - Can't log in (Solutions from do6uk)

Closed this issue · 7 comments

Hello
I have used this code for the last 6 months, on daily basis, without any problems, now have started to get
API warnings - "Access file not found"
Nothing has been changed in my code. My last successful execution was yesterday (28. January 2022 12.05)

I have no change in user id or password.
Can access the account with my Weconnect app, Weconnect ID app and from the myvolkswagen.net homepage

I can see in the log file some kind of redirection there is going wrong: Error 302.

Any suggestion on how to solve it?

Thanks

Here is some data from the log
[29/01/2022 10:57:53] [API::WARNING] Access file not found
[29/01/2022 10:57:53] [API::INFO] logger
[29/01/2022 10:57:53] [API::DEBUG] Checking tokens
[29/01/2022 10:57:53] [API::DEBUG] Token checking failed
[29/01/2022 10:57:53] [API::WARNING] Forcing login
[29/01/2022 10:57:53] [API::INFO] Attempting to login
[29/01/2022 10:57:53] [API::DEBUG] Login parameters: {'prompt': 'login', 'state': '6bkhsihwuAxLGOCqQxuNcCaJpXI06Lg30vY9BpAoby6', 'response_type': 'code id_token token', 'code_challenge_method': 's256', 'scope': 'openid profile mbb cars birthdate nickname address phone', 'code_challenge': 'jvAGJOSrWk20-PY48nlDya6RiibpE_heYcaxT2nmmdM', 'redirect_uri': 'carnet://identity-kit/login', 'client_id': '9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com', 'nonce': '6wVdu4W0Fdn0AuBUYH2FWPXKW7Rme7S49BQpY3PpQw3'}
[29/01/2022 10:57:54] [API::INFO] Sending GET request to https://identity.vwgroup.io/signin-service/v1/signin/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com?relayState=2e6ac3f995f8ff3a2ae3f00f88d7068ea7e8cb86
[29/01/2022 10:57:54] [API::DEBUG] Parameters: https://identity.vwgroup.io/signin-service/v1/signin/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com?relayState=2e6ac3f995f8ff3a2ae3f00f88d7068ea7e8cb86
[29/01/2022 10:57:54] [API::DEBUG] Headers: {'User-Agent': 'python-requests/2.25.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive', 'Cookie': 'SESSION=NGY5YjllZmEtZDYyYS00ZWNlLWFiZjYtNDFhMDMyNDUxOWQx; vcap_journey=0739660b-afe5-43bb-baf2-52928b1c8e76'}
[29/01/2022 10:57:54] [API::INFO] Response with code: 200
[29/01/2022 10:57:54] [API::DEBUG] Headers: {'Date': 'Sat, 29 Jan 2022 09:57:54 GMT', 'Content-Type': 'text/html;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Content-Language': 'en', 'Expires': '0', 'Pragma': 'no-cache', 'Set-Cookie': 'SESSION=MWE0ZTI3NDAtMWUyZi00MDViLWEzMzgtYmVlNWJjMjQ4NWMw; Path=/signin-service/v1/; Secure; HttpOnly; SameSite=Lax', 'Strict-Transport-Security': 'max-age=31536000 ; includeSubDomains', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'DENY', 'X-Vcap-Request-Id': '070adde6-5e60-422c-6518-88bd850e0d63', 'X-Xss-Protection': '1; mode=block'}
[29/01/2022 10:57:54] [API::DEBUG] History: [<Response [302]>]
[29/01/2022 10:57:54] [API::INFO] Found email login url: /signin-service/v1/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com/login/identifier
[29/01/2022 10:57:54] [API::INFO] Sending GET request to https://identity.vwgroup.io/signin-service/v1/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com/login/authenticate?relayState=2e6ac3f995f8ff3a2ae3f00f88d7068ea7e8cb86
[29/01/2022 10:57:54] [API::DEBUG] Parameters: https://identity.vwgroup.io/signin-service/v1/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com/login/authenticate?relayState=2e6ac3f995f8ff3a2ae3f00f88d7068ea7e8cb86
[29/01/2022 10:57:54] [API::DEBUG] Headers: {'User-Agent': 'python-requests/2.25.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive', 'Cookie': 'SESSION=MWE0ZTI3NDAtMWUyZi00MDViLWEzMzgtYmVlNWJjMjQ4NWMw; vcap_journey=0739660b-afe5-43bb-baf2-52928b1c8e76'}
[29/01/2022 10:57:54] [API::INFO] Response with code: 200
[29/01/2022 10:57:54] [API::DEBUG] Headers: {'Date': 'Sat, 29 Jan 2022 09:57:54 GMT', 'Content-Type': 'text/html;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Content-Language': 'en', 'Expires': '0', 'Pragma': 'no-cache', 'Strict-Transport-Security': 'max-age=31536000 ; includeSubDomains', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'DENY', 'X-Vcap-Request-Id': 'b52b87eb-c1b4-4d04-55c9-06c822ad0314', 'X-Xss-Protection': '1; mode=block'}
[29/01/2022 10:57:54] [API::DEBUG] History: [<Response [303]>]
[29/01/2022 10:57:54] [API::CRITICAL] Raising error msg: This account does not exist
Traceback (most recent call last):
File "/volume1/web/volkswagen/weconnect/weNew.py", line 34, in
vwc.login()
File "/volume1/web/volkswagen/weconnect/NativeAPI.py", line 278, in login
return self.__force_login()
File "/volume1/web/volkswagen/weconnect/NativeAPI.py", line 333, in __force_login
raise VWError('This account does not exist')
NativeAPI.VWError: This account does not exis

do6uk commented

Same problem - Connection breaks 28.01.2022 12:30

Who is able to "translate" the fixes commented by andig to Python?

Dear andig,
do you have a solution for this problem?
I have the same issue since a few days:
[30/01/2022 12:32:10] [API::CRITICAL] Raising error msg: This account does not exist
In WeConnect App averything is working fine.

andig commented

See links above- login needs be fixed.

do6uk commented

i've done a quick'n'dirty fix in my fork do6uk/weconnect

thanks to do6uk for sharing.

It works, here is what I did to use the code.

In the original nativeAPI.py

Replace lines 319 to 341 both include with lines 324 to 349 in nativeAPI.py from do6uk
Go to the top of the nativeAPI.py, and add "import re" after the current import statements

thank to do6uk from my site too.

It works fine with the same changes as sailor1958 has done.