skodaconnect / homeassistant-skodaconnect

Skoda Connect - A home assistant plugin to add integration with your car
Apache License 2.0
232 stars 28 forks source link

Cannot connect to Skoda Connect (strange behavior via MySkoda app) #112

Closed gpuccio87 closed 2 years ago

gpuccio87 commented 2 years ago

Cannot connect to Skoda Services via Hassio. Everything was working fine until 2 days ago. Now i'm stucked at the login page. I can't login from the MySkoda app either via WiFi (tried with 2 smartphones), but I can connect via LTE. If I connect to MySkoda app via 4G, I can switch to WiFi and everything works fine. I can login to MySkoda app if I'm connected to a VPN, even if it's my personal VPN server (same external ip as my router). I can connect to skoda-connect.com site from my pc (I thought that for some reason they had banned my ip).

2022-02-18 00:50:39 INFO (MainThread) [skodaconnect.connection] Init Skoda Connect library, version 1.1.19 2022-02-18 00:50:39 DEBUG (MainThread) [skodaconnect.connection] Using service https://msg.volkswagen.de 2022-02-18 00:50:39 INFO (MainThread) [skodaconnect.connection] Initiating new login 2022-02-18 00:50:39 DEBUG (MainThread) [skodaconnect.connection] Starting authorization process for client skoda 2022-02-18 00:50:40 DEBUG (MainThread) [skodaconnect.connection] Got redirect to signin-service 2022-02-18 00:50:40 DEBUG (MainThread) [skodaconnect.connection] Start authorization for user @.com 2022-02-18 00:50:40 DEBUG (MainThread) [skodaconnect.connection] Found dynamic credentials form, extracting attributes 2022-02-18 00:50:40 DEBUG (MainThread) [skodaconnect.connection] JSON: {'clientLegalEntityModel': {'clientId': '@apps_vw-dilab_com', 'clientAppName': 'ŠKODA App & Portal', 'clientAppDisplayName': 'ŠKODA App & Portal', 'legalEntityInfo': {'name': 'ŠKODA', 'shortName': 'SKODA', 'productName': 'ŠKODA ID', 'theme': 'skoda', 'defaultLanguage': 'cs', 'termAndConditionsType': 'DEFAULT', 'legalProperties': {'revokeDataContact': 'DPOffice@skoda-auto.cz', 'imprintText': 'IMPRINT', 'countryOfJurisdiction': 'CZ'}}, 'imprintTextKey': 'imprint.link.text'}, 'template': 'loginAuthenticate', 'hmac': '', 'useClientRendering': True, 'emailPasswordForm': {'email': '@.com', 'password': None}, 'error': None, 'relayState': '***', 'nextButtonDisabled': False, 'enableNextButtonAfterSeconds': 0, 'postAction': 'login/authenticate', 'identifierUrl': 'login/identifier'} 2022-02-18 00:50:40 DEBUG (MainThread) [skodaconnect.connection] Finalizing login 2022-02-18 00:50:40 DEBUG (MainThread) [skodaconnect.connection] Received authorization code, exchange for tokens.

The debug log reports nothing else

Farfar commented 2 years ago

@gpuccio87 How long have you waited? Because it looks like it waits for a connection to the token service. No problem with DNS? Can you resolve the host tokenrefreshservice.apps.emea.vwapps.io and access https://tokenrefreshservice.apps.emea.vwapps.io/exchangeAuthCode? If you connect via browser it should give you HTTP 405.

gpuccio87 commented 2 years ago

@Farfar I thought so too. I tried to change DNS, but the result is the same. I tried to wait 5 minutes. then it gives me error. The site gives me 405

Farfar commented 2 years ago

What's the error you get after 5 minutes? Do you have any firewall that might block this? Since the app behaves the same but it works over LTE I suspect that the issue is between your devices and the tokenrefresh host.

Farfar commented 2 years ago

I can login to MySkoda app if I'm connected to a VPN, even if it's my personal VPN server (same external ip as my router). I can connect to skoda-connect.com site from my pc (I thought that for some reason they had banned my ip).

I read this part again and it sounds like there's an issue with your router/firewall, alternatively with your internal network/wifi. The skoda connect web app works a little differently than the app and integration so it's not directly comparable.

gpuccio87 commented 2 years ago

The message is: "I can't log in to Skoda Connect, please check your credentials and verify that the service is working". I understand that the problem is with my router, but I can't figure out what. It worked until two days ago, and I haven't changed anything. I don't have firewall

allhq commented 2 years ago

I have the same problem.

gpuccio87 commented 2 years ago

I have the same problem.

Do you have problems with Hassio, MySkoda or both?

allhq commented 2 years ago

Skoda connect, and MySkoda. MySkoda login --> Unkown error pls call support..

Farfar commented 2 years ago

Can you guys please make sure that login works with skoda connect online portal, in two different web browsers. Sometimes there's new T&C that won't show in Chrome for instance.

gpuccio87 commented 2 years ago

Tried yesterday from Brave, Edge and Firefox. I tried again some minutes ago. Same result, no Terms and Conditions to accept.

Is it normal to have this redirections from the Skoda Connect login prompt to the vehicle "dashboard"?

https://identity.vwgroup.io/signin-service/v1/d2d5cfa4-fdeb-44cb-a621-853c649748ad@apps_vw-dilab_com/login/authenticate?relayState=b61cfda086c8c0c95e8bb0bee***

redirects to

https://www.skoda-connect.com/wrapper-callback?state=47db70bfb209478***&code=eyJraWQiOiIzO***

redirects to

https://www.skoda-connect.com/callback?state=fbb21***5&code=eyJraWQi***

redirects to

https://www.skoda-connect.com/vehicle/TM***

gpuccio87 commented 2 years ago

Tried to run this on my pc (same network): https://github.com/lendy007/skodaconnect

After a few minutes of waiting, it seems to have worked. I can send the log, maybe it can help

Farfar commented 2 years ago

After a few minutes of waiting, it seems to have worked. I can send the log, maybe it can help

Yes please sen the sanitised log and I'll have a look. But if it works after a number of minutes it's probably just network issues/delays. In some rare cases it seems like your IP is being load balanced to a certain server and it might cause issues if that server is under heavy load or not working properly. I don't have any proof for this but it's how it seems to me (I have a background working it networking and working with ADC's).

gpuccio87 commented 2 years ago

I sent you the log by email. Thanks

Farfar commented 2 years ago

I sent you the log by email. Thanks

Thank you. I can't see anything strange though, only that login takes about 2 minutes 50 which is a couple of minutes longer than it should, when all is working well.

gpuccio87 commented 2 years ago

Problem solved, I don't know how. Thanks a lot for your patience!