Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid credentials #169

Closed
menloperk opened this issue Feb 28, 2023 · 43 comments · Fixed by #172
Closed

Invalid credentials #169

menloperk opened this issue Feb 28, 2023 · 43 comments · Fixed by #172
Labels

Comments

@menloperk
Copy link

Stopped working for me (I guess) 1 day ago. Deleted the integration and added again. Now I can only get 'Invalid Credentials' where I have checked they do really work when logging in to my.audi.com and they were also working before. Could it be this integration is now broken due to changes at Audi side?

@gerofeldmann
Copy link

Hi, I have the exact same problem- Login works on mobile device and Browser. It just stopped working on Home Assistant.

@tieskuh
Copy link

tieskuh commented Feb 28, 2023

Same here…

@eightsixeight
Copy link

same here even reset pin... @menloperk what logs do you need ?

@tieskuh
Copy link

tieskuh commented Feb 28, 2023

Duplicate of #168 I suppose

@ChrisPolewiak
Copy link

There was an mobile app update, maybe producer change some API and now it is not compatible.
Some must deeply analyse what VW changed...

@Frankster-NL
Copy link

This should be fixed easily. If I look at: evcc-io/evcc#6522:

@menloperk
Copy link
Author

menloperk commented Mar 1, 2023

Yes, I have applied these as a temp fix to my audi_services.py and all is good now for me until we get a formal update.

@ChrisPolewiak
Copy link

ChrisPolewiak commented Mar 1, 2023

Can you share what you modify in your file. Thanks.

@menloperk
Copy link
Author

menloperk commented Mar 1, 2023

Here's a diff between original and fixed... (btw, had to restart HA after applying these before being able to add the integration again)...

ubuntu@node1:~/appdata/homeassistant/config/custom_components/audiconnect$ diff audi_services.py.orig audi_services.py
757c757
<         marketcfg_url = "https://content.app.my.audi.com/service/mobileapp/configurations/market/{c}/{l}?v=4.13.0".format(
---
>         marketcfg_url = "https://content.app.my.audi.com/service/mobileapp/configurations/market/{c}/{l}?v=4.15.0".format(
760c760
<         openidcfg_url = "https://idkproxy-service.apps.{0}.vwapps.io/v1/{0}/openid-configuration".format(
---
>         openidcfg_url = "https://{0}.bff.cariad.digital/login/v1/idk/openid-configuration".format(
771c771
<         self._authorizationServerBaseURLLive = "https://aazsproxy-service.apps.emea.vwapps.io"
---
>         self._authorizationServerBaseURLLive = "https://emea.bff.cariad.digital/login/v1/audi"
787c787
<         self._tokenEndpoint = "https://idkproxy-service.apps.emea.vwapps.io/v1/emea/token"
---
>         self._tokenEndpoint = "https://emea.bff.cariad.digital/login/v1/idk/token"
791c791
<             "https://idkproxy-service.apps.emea.vwapps.io/v1/emea/revoke"
---
>             "https://emea.bff.cariad.digital/login/v1/idk/revoke"

@menloperk
Copy link
Author

Only entity missing for me now is device_tracker.audi_e_tron_position...

@gllmlbrt
Copy link
Contributor

gllmlbrt commented Mar 1, 2023

Confirm all works for me with the above update. Including the position sensor which updates all fine.
I would be happy to make a PR on this, but I am not sure there is any maintenance done actively so it would not be merged anytime soon. So instead I share the whoel audi_service.py here that you can download, repalce the extension from .txt to .py and override in your custom_components/audiconnect folder
audi_services.txt

@gllmlbrt
Copy link
Contributor

gllmlbrt commented Mar 1, 2023

I created a fork and PR with https://github.com/t0bias-r/audi_connect_ha/pull/1 for those interested, as I use the @t0bias-r fork with all doors sensors...

This was referenced Mar 1, 2023
@menloperk
Copy link
Author

Confirm all works for me with the above update. Including the position sensor which updates all fine. I would be happy to make a PR on this, but I am not sure there is any maintenance done actively so it would not be merged anytime soon. So instead I share the whoel audi_service.py here that you can download, repalce the extension from .txt to .py and override in your custom_components/audiconnect folder audi_services.txt

Deleted the integration again, restarted and suddenly had 1 additional entity (position) and 36 in total! Don't know what happened before but seems to be alright now since position is looking OK again.

@synack666
Copy link

Thanks a lot!!!

@shuntfield
Copy link

image
Confirm its all working with the changes made to the audi_services.py from the message.

Good work!

@TFhdKi95ae8L
Copy link

I created a fork and PR with https://github.com/t0bias-r/audi_connect_ha/pull/1 for those interested, as I use the @t0bias-r fork with all doors sensors...

Thank you for this!

@Larnak23
Copy link

Larnak23 commented Mar 4, 2023

Thanks it works again

@b3rtdb
Copy link

b3rtdb commented Mar 4, 2023

Wonderful, works again after replacing and restart.
Thanks !!

@philipp-luettecke
Copy link

I can also confirm.
After changing above lines on the current install 70eef5d a login was successful again.

Thanks!

@eightsixeight
Copy link

i would say this is not a bitcoin transaction thus does not need 450 confirmations, i think we get that it works ;)

@chemgeek
Copy link

chemgeek commented Mar 7, 2023

I still get an error that my credentials are invalid. I tried to delete the integration, restarted, re-download it, copied audi_services.py file, restarted, and still shows invalid credentials. Not sure what to do at this point. I am in the US if that helps.

@ikavior
Copy link

ikavior commented Mar 7, 2023

@chemgeek, same here. Im from EU.

@chemgeek
Copy link

chemgeek commented Mar 7, 2023

I still get an error that my credentials are invalid. I tried to delete the integration, restarted, re-download it, copied audi_services.py file, restarted, and still shows invalid credentials. Not sure what to do at this point. I am in the US if that helps.

I see there was some emea stuff hardcoded still in the original version which may have worked before but apparently may be broken in the latest update from Audi. I have changed that to be more dynamic. You can try that fix if you want to see if it helps you!? (again, change file type to .py)

audi_services.txt

Unfortunately, that did not work. Thanks for the effort.

@menloperk
Copy link
Author

I still get an error that my credentials are invalid. I tried to delete the integration, restarted, re-download it, copied audi_services.py file, restarted, and still shows invalid credentials. Not sure what to do at this point. I am in the US if that helps.

I see there was some emea stuff hardcoded still in the original version which may have worked before but apparently may be broken in the latest update from Audi. I have changed that to be more dynamic. You can try that fix if you want to see if it helps you!? (again, change file type to .py)
audi_services.txt

Unfortunately, that did not work. Thanks for the effort.

Sorry, I was a bit too early with that post so I deleted it. I guess it still found you though 😏. I will have a look later

@t0bias-r
Copy link
Contributor

t0bias-r commented Mar 8, 2023

If Audi (or VW) updates the terms of use, you have to login on the MyAudi website and accept the new terms of use, otherwise the script cannot log in.

@gllmlbrt
Copy link
Contributor

gllmlbrt commented Mar 8, 2023

If Audi (or VW) updates the terms of use, you have to login on the MyAudi website and accept the new terms of use, otherwise the script cannot log in.

I also solved this issue with the app, by logging out and loggin in again (you are then asked to accept the new terms). Then re-logging in the integration.

@chemgeek
Copy link

chemgeek commented Mar 8, 2023

I don't get it. I've tried everything listed and still get "invalid credentials."

@menloperk
Copy link
Author

I don't get it. I've tried everything listed and still get "invalid credentials."

Hey there, as said, the integration was definitely still broken for the US specifcally as some URLs were hardcoded to default to 'emea' and the name in the openid config file had also changed so it wasn't set dynamically. I believe I have now fixed that too but being in Europe I can't test it. At least the updated .py file is working for me so it should have no real errors in it.
So if you could test this... just wanna make sure you're using US as country in the integration config and also that you're able to login to either app or website and that you accepted all terms, etc. before testing.
Also, probably best or even mandatory to delete your existing audi connect integration first, then restart HA, and then try to add the integration again providing your credentials, PIN, country, etc.

audi_services.txt

@aIA78
Copy link

aIA78 commented Mar 9, 2023

I'm trying install HA integration but fails with "Invalid credentials". Have been updated the app in the repo? Thanks a lot.

@chemgeek
Copy link

chemgeek commented Mar 9, 2023

I don't get it. I've tried everything listed and still get "invalid credentials."

Hey there, as said, the integration was definitely still broken for the US specifcally as some URLs were hardcoded to default to 'emea' and the name in the openid config file had also changed so it wasn't set dynamically. I believe I have now fixed that too but being in Europe I can't test it. At least the updated .py file is working for me so it should have no real errors in it. So if you could test this... just wanna make sure you're using US as country in the integration config and also that you're able to login to either app or website and that you accepted all terms, etc. before testing. Also, probably best or even mandatory to delete your existing audi connect integration first, then restart HA, and then try to add the integration again providing your credentials, PIN, country, etc.

audi_services.txt

This worked! Thank you.

@menloperk
Copy link
Author

I'm trying install HA integration but fails with "Invalid credentials". Have been updated the app in the repo? Thanks a lot.

No, not yet. There is just a quick fix for now, see the above post. I am also waiting for an official update from the maintainer so I can update through HACS.

@rosshenning
Copy link

rosshenning commented Mar 9, 2023

As best I can tell, Audi has gone and changed their endpoint yet again today. It's freshly not working for me again as of this morning:

Logger: custom_components.audiconnect.audi_connect_account
Source: custom_components/audiconnect/audi_connect_account.py:94
Integration: Audi Connect
First occurred: 12:06:12 PM (9 occurrences)
Last logged: 12:21:49 PM

Login to Audi service failed, trying again in 10 seconds
Login to Audi service failed: Cannot connect to host idkproxy-service.apps.na.vwapps.io:443 ssl:default [Name does not resolve]

@chemgeek
Copy link

The integration fails to initialize after updating via HACS to new version that appeared a couple days ago. Not sure how to resolve.

@menloperk
Copy link
Author

That is because the new version is still broken for US. See my previous post. You should ask Arjen to also incorporate those minor changes so it will again also work for the US (as you tested it) in the official release.

@menloperk menloperk reopened this Mar 19, 2023
@menloperk
Copy link
Author

Reopened since it is still not working in US.

@menloperk
Copy link
Author

menloperk commented Mar 19, 2023

These lines (based on diff) are still missing, so it is still broken for US:

771c771,772
<         self._authorizationServerBaseURLLive = "https://emea.bff.cariad.digital/login/v1/audi"
---
>         self._authorizationServerBaseURLLive = "https://{0}.bff.cariad.digital/login/v1/audi".format(
>            "na" if self._country.upper() == "US" else "emea")
787c788,789
<         self._tokenEndpoint = "https://emea.bff.cariad.digital/login/v1/idk/token"
---
>         self._tokenEndpoint = "https://{0}.bff.cariad.digital/login/v1/idk/token".format(
>            "na" if self._country.upper() == "US" else "emea")
791c793,794
<             "https://emea.bff.cariad.digital/login/v1/idk/revoke"
---
>             "https://{0}.bff.cariad.digital/login/v1/idk/revoke".format(
>                "na" if self._country.upper() == "US" else "emea")

Arjen, could you please update these too?
Thanks, Rene.

@chemgeek
Copy link

That is because the new version is still broken for US. See my previous post. You should ask Arjen to also incorporate those minor changes so it will again also work for the US (as you tested it) in the official release.

Yes, went back to the provided audi_services.py and all works again. Thanks!

@LCMilstein
Copy link

@chemgeek and @menloperk and others, this seems to have broken again with the release of My Audi 4.17.0. Would you be able to propose a diff that I could try to see if I can get it working and/or tell me how you're finding these URLs so I can try to investigate on my end? I am not sure where to begin.

@t0bias-r
Copy link
Contributor

t0bias-r commented Jun 1, 2023

@chemgeek and @menloperk and others, this seems to have broken again with the release of My Audi 4.17.0. Would you be able to propose a diff that I could try to see if I can get it working and/or tell me how you're finding these URLs so I can try to investigate on my end? I am not sure where to begin.

@LCMilstein, @chemgeek, @menloperk Implementation works on my end. Not every app update includes breaking changes. There seem to be problems with the Audi backend at the moment, as the app also show errors on a daily basis.
grafik
grafik

@asemev
Copy link

asemev commented Jun 4, 2023

still doesnt work :(

@asemev
Copy link

asemev commented Jun 10, 2023

its now suddenly working again. but its showing only 2 entities :(

Copy link

This issue is stale because it has been open for 30 days with no activity. Are you still experiencing this issue?

@github-actions github-actions bot added the stale label Mar 13, 2024
Copy link

github-actions bot commented Apr 7, 2024

This issue was closed because it has been inactive for 30 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.