cjaliaga / home-assistant-aquarea

Home Assistant integration for Panasonic Aquarea devices connected to Aquarea Smart Cloud
MIT License
82 stars 13 forks source link

[Bug]: Authentication errors with 0.7.1 #116

Closed fbenniks closed 3 months ago

fbenniks commented 3 months ago

The problem

When i manually logon via https://accountglb.digital.panasonic.com/ it seems MFA is enabled by default and cant be disabled.

In home assistant i see the following message

Config entry 'email@email.com' for aquarea integration could not authenticate: Authentication error: 1001-1401 - Invalid username or password.

In logs it shows

This error originated from a custom integration.

Logger: custom_components.aquarea.config_flow Source: custom_components/aquarea/config_flow.py:144 integration: Aquarea Smart Cloud (documentation, issues) First occurred: 10:26:12 (2 occurrences) Last logged: 10:26:17

Unexpected exception Traceback (most recent call last): File "/config/custom_components/aquarea/config_flow.py", line 144, in _validate_input await self._api.login() File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 274, in login await self.__login_production() File "/usr/local/lib/python3.12/site-packages/aioaquarea/core.py", line 334, in __login_production csrf = response.cookies.get("_csrf").value ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'value'

What version of Home Assistant Core are you running?

core-2024.6.4

What type of installation are you running?

Home Assistant Container

What version of the integration are you running?

0.7.1 (latests in hacs)

Device description

Not relevant:)

Is the integration loading?

Yes

Is the adapter able to connect to the Aquarea Smart Cloud with a stable internet connection?

Yes

Are you able to perform the action you're trying to with the Aquarea Smart Cloud Site/App?

Yes

Area of the issue

No response

Anything in the logs?

No response

Additional information

No response

fbenniks commented 3 months ago

the manifest file reports version 0.7.0 instead of 0.7.1 this caused some me some headaches because i was trying to update to 0.7.1 hoping to solve my issue but home assistant was reporting 0.7.0:)

fbenniks commented 3 months ago

I cloned aioaquarea and ran it locally. Authentication works. I retried it from Home assistant and now it works. I am unable to pinpoint the reason. I suspect Panasonic had a issue on their backend.

I think the issue occurred because i never logged in on smart cloud web application after they enabled MFA. I think maybe my account was blocked from OAuth machine login until i started a MFA login on web. It took up to 48h after i logged in with MFA before the integration started working again.