tillsteinbach / WeConnect-python

Python API for the Volkswagen WeConnect Services
MIT License
105 stars 28 forks source link

Unable to login - KeyError: 'location' #108

Closed cvaabenl closed 1 year ago

cvaabenl commented 1 year ago

Describe the bug When running the sample allVehicles.py using verified and working username and password, I get an KeyError and login fails.

To Reproduce Run allVehicles.py

Expected behavior Login should succeed and a list of registered vehicles be displayed.

Logs

#  Initialize WeConnect
#  Login
Traceback (most recent call last):
  File "/Users/vaaben/git/flaf/test.py", line 30, in <module>
    main()
  File "/Users/vaaben/git/flaf/test.py", line 19, in main
    weConnect.login()
  File "/Users/vaaben/git/flaf/venv/lib/python3.10/site-packages/weconnect/weconnect.py", line 184, in login
    self.__session.login()
  File "/Users/vaaben/git/flaf/venv/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 75, in login
    authorizationUrl = self.authorizationUrl(url='https://identity.vwgroup.io/oidc/v1/authorize')
  File "/Users/vaaben/git/flaf/venv/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 96, in authorizationUrl
    redirect = tryLoginResponse.headers['Location']
  File "/Users/vaaben/git/flaf/venv/lib/python3.10/site-packages/requests/structures.py", line 52, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'location'

Additional context AuthorizationUrl seems to have changed and a 404 is returned.

cvaabenl commented 1 year ago

This is a duplicate of https://github.com/tillsteinbach/VWsFriend/issues/435 - closing