albaintor / homeassistant_electrolux_status

Get the status from your Electrolux Care devices
MIT License
83 stars 20 forks source link

aiohttp gets 403, message='Forbidden' #62

Open origama opened 1 week ago

origama commented 1 week ago

For some months already I am not able to run the integration because of the authentication issues. As far as I can read around the new versions should have fixed this authentication issue but for some reason I am still affected.

The last time I tried was a couple of minutes ago, tested version v1.0.19. I am installing it manually on a containerized homeassistant, where in the past was able to run correctly.

Now when I install the integration from the HA UI I get the error: Failed to set up: check the logs

while from the logs I see:

2024-09-11 22:37:23.602 ERROR (MainThread) [custom_components.electrolux_status] Could not log in to ElectroluxStatus, 403, message='Forbidden', url=URL('https://accounts.eu1.gigya.com/accounts.login')
2024-09-11 22:37:23.602 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry XXXXX@gmail.com for electrolux_status
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/electrolux_status/__init__.py", line 46, in async_setup_entry
    if not await coordinator.async_login():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/electrolux_status/coordinator.py", line 39, in async_login
    raise ex
  File "/config/custom_components/electrolux_status/coordinator.py", line 32, in async_login
    token = await self.api.get_user_token()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyelectroluxocp/oneAppApi.py", line 126, in get_user_token
    id_token = await gigya_client.login_user(self._username, self._password)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyelectroluxocp/gigyaClient.py", line 289, in login_user
    session = await self.login_session(username, password, gmid, ucid)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyelectroluxocp/gigyaClient.py", line 240, in login_session
    response.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1070, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://accounts.eu1.gigya.com/accounts.login')

I am using a working password that has been reset to be absolutely sure it was correct.

Am I doing anything wrong?

JJanssen123 commented 6 days ago

I have the same issue, the same log message. Mine is a brand new AEG washer and a brand new AEG account created with the new AEG app. The AEG Care app is not working, it says it is obsolete and I have to use the new AEG app

origama commented 5 days ago

I successfully migrated from the old app to the new one and I can successfully manage my AEG washing machine from the new app. But I can't get the integration to pass the authentication step because of the issue above

JJanssen123 commented 5 days ago

I managed to fix my issue today. I tried to login in aeg.nl for the first time, with the account and password I made in the (new) app. But website said the password was wrong. I changed it using "forgot password" into the password I created in the app. Now the integration is able to connect!

Maybe changing the password through the aeg-website into your app-password can help you as well?

origama commented 5 days ago

@JJanssen123 that was a great catch. After I accessed the aeg site (in my case aeg.it ) the password was accepted on the integration login. The log is now gone and I am getting all the sensors as expected. @albaintor I think this step should be mentioned in the documentation.