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

Possibly changed access token json response from accessToken to token #994

Open
tuomari opened this issue Nov 14, 2024 · 0 comments
Open

Comments

@tuomari
Copy link

tuomari commented Nov 14, 2024

Describe the bug
When trying to configure the application, I receive an error:

Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 59, in __init__
 self.token = res.json()["accessToken"] 
KeyError: 'accessToken'

HOST_BRANDID : https://id-dcr.peugeot.com/mobile-services sitecode: AP_FI_ESP{"returnCode":"OK","token":"<clipped-valid-access-token>"}

So it seems that I receive a valid access token, but the key has changed from accessToken to token

Full error log from console:

hassio-peugeot_psacc-1  | 2024-11-14 19:30:46,575 :: ERROR :: Traceback (most recent call last):
hassio-peugeot_psacc-1  |   File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 59, in __init__
hassio-peugeot_psacc-1  |     self.token = res.json()["accessToken"]
hassio-peugeot_psacc-1  | KeyError: 'accessToken'
hassio-peugeot_psacc-1  |
hassio-peugeot_psacc-1  | HOST_BRANDID : https://id-dcr.peugeot.com/mobile-services sitecode: AP_FI_ESP{"returnCode":"OK","token":"<clipped-valid-access-token>"}
hassio-peugeot_psacc-1  | 2024-11-14 19:30:46,576 :: ERROR :: Traceback (most recent call last):
hassio-peugeot_psacc-1  |   File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 59, in __init__
hassio-peugeot_psacc-1  |     self.token = res.json()["accessToken"]
hassio-peugeot_psacc-1  | KeyError: 'accessToken'
hassio-peugeot_psacc-1  |
hassio-peugeot_psacc-1  | HOST_BRANDID : https://id-dcr.peugeot.com/mobile-services sitecode: AP_FI_ESP{"returnCode":"OK","token":"<clipped-valid-access-token>"}
hassio-peugeot_psacc-1  | Traceback (most recent call last):
hassio-peugeot_psacc-1  |   File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 59, in __init__
hassio-peugeot_psacc-1  |     self.token = res.json()["accessToken"]
hassio-peugeot_psacc-1  | KeyError: 'accessToken'
hassio-peugeot_psacc-1  |
hassio-peugeot_psacc-1  | The above exception was the direct cause of the following exception:
hassio-peugeot_psacc-1  |
hassio-peugeot_psacc-1  | Traceback (most recent call last):
hassio-peugeot_psacc-1  |   File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_views.py", line 137, in connectPSA
hassio-peugeot_psacc-1  |     INITIAL_SETUP = InitialSetup(app_name, email, password, countrycode)
hassio-peugeot_psacc-1  |   File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 68, in __init__
hassio-peugeot_psacc-1  |     raise ConnectionError(msg) from ex
hassio-peugeot_psacc-1  | ConnectionError: Traceback (most recent call last):
hassio-peugeot_psacc-1  |   File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 59, in __init__
hassio-peugeot_psacc-1  |     self.token = res.json()["accessToken"]
hassio-peugeot_psacc-1  | KeyError: 'accessToken'
hassio-peugeot_psacc-1  |
hassio-peugeot_psacc-1  | HOST_BRANDID : https://id-dcr.peugeot.com/mobile-services sitecode: AP_FI_ESP{"returnCode":"OK","token":"<clipped-valid-access-token>"}
hassio-peugeot_psacc-1  | 2024-11-14 19:30:46,582 :: INFO :: 192.168.100.67 - - [14/Nov/2024 19:30:46] "POST /_dash-update-component HTTP/1.1" 200 -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant