gvigroux / hon

Support of all Haier, Candy, Hoover appliances integrated in the official hOn mobile app. Direct access to all possible services and parameters
MIT License
135 stars 51 forks source link

Invalid csfr #71

Closed KiraPC closed 1 year ago

KiraPC commented 1 year ago

After a while the integration is running I'm facing the following log inside my HA installation:

2023-03-30 07:21:57.210 ERROR (MainThread) [custom_components.hon.hon] Unable to retreive the frontdoor URL. Message: */{"event":{"descriptor":"markup://aura:invalidSession","attributes":{"values":{"newToken":"invalid_csrf"}}},"exceptionMessage":"Expected 3 tokens in all","exceptionEvent":true}/*ERROR*/
2023-03-30 07:21:57.388 ERROR (MainThread) [custom_components.hon.hon] Unable to get the state of the hOn device. HTTP code: 403 and text[{"Message":"User is not authorized to access this resource with an explicit deny"}]
gvigroux commented 1 year ago

Does the integration stop working after that ? After a period of time, the authentication expired and we need to authenticate again. On my side it works despite the error message

KiraPC commented 1 year ago

Did not check if it was working. Maybe if this message is not regard a blocking step you could put it as debug or warn level

KiraPC commented 1 year ago

Hi @gvigroux

I'm receiving this error now and the integration stopped working (status of the appliance not getting update)

Unable to get the state of the hOn device. HTTP code: 403 and text[{"Message":"User is not authorized to access this resource with an explicit deny"}]

I think there is some error during autorization

gvigroux commented 1 year ago

I will publish an update soon to optimize the renewal of the authorization. Should be better

KiraPC commented 1 year ago

Ok, perfect.

gvigroux commented 1 year ago

I just updated the code. Please try :) I will close this ticket