Open viliusdidit opened 4 months ago
my attempts to generate/guess/reuse state param for authglb endpoint fail with this error:
{"statusCode":403,"description":"Invalid state","name":"AnomalyDetected","code":"access_denied"}
anyone out there more familiar with this oauth2 aspect? or is it some kind of secret authglb is expecting to be encoded in the state? fwiw, there was no forced upgrade on mobile app side, Dec 2023 still works with this auth.
Same error happening here. I saw that on Native Panasonic Cloud app there was a new "policy" notes to be accepted.
Thanks.
the good news: this new authglb seems to allow multiple logins. at least when using google login which is an option now (apple id as well; need to register here - https://accountglb.digital.panasonic.com/social first)
Thanks @viliusdidit for all the investigation so far, let's see what we can do. The ideal (in a happy world) solution would be for us to not need to use the username and password and being able to auth as a service/application to Panasonic cloud, get a token, and use that token, with the possibility of getting a refresh_token as well. Unfortunately I don't see that happening.
Thanks @viliusdidit for all the investigation so far, let's see what we can do. The ideal (in a happy world) solution would be for us to not need to use the username and password and being able to auth as a service/application to Panasonic cloud, get a token, and use that token, with the possibility of getting a refresh_token as well. Unfortunately I don't see that happening.
hopefully you can make it happen for all of us somehow š
In case it helps, I noticed this NPM library that takes a different approach: it "impersonates" the iOS app using a different set of APIs.
Just sharing due to the lack of public documentation from Panasonic around their APIs.
Hey guys, I found your issue by searching if someone fixed the new login way to Panasonic Cloud. As nobody did, here is the working code: https://github.com/Hernas/homebridge-panasonic-heat-pump/commit/dd04fc2b7a207a2648d7ad94bb8eb19052d21bf2
I hope that helps! :)
Thanks a lot @bimusiek, I'll take a look ASAP.
@cjaliaga, I have seen that the fix has been implemented in dedicated branch. I don't know if there are some technical issues to be solved, but if you are afraid of exposing the hard-coded client id, maybe it can be provided by the user during the integration config flow.
The clientId was copied from JS code of OAuth provider at Panasonic so you could fetch it from there. AFAIK it is Panasonic client id from their oauth provider so it is not secret and should not change.
Thanks @lcavalli, as @bimusiek said this Client Id it's not a secret and shouldn't change. Thanks for stepping in š
I'm implementing it on this branch: https://github.com/cjaliaga/aioaquarea/blob/7ddd0eac009a23a4b60aea42f20eb36c773281f6/aioaquarea/core.py#L349
To give an update, I'm currently stuck on the response 3 (call with the username and password to https://authglb.digital.panasonic.com/usernamepassword/login). I'll need to check if I'm not sending all the required cookies, the json sent with aiohttp is not properly encoded, something else.. or there's something wrong with my username because the response I get from the endpoint is a Bad Request - 400 invalid username
I'll check with @bimusiek project and my username/password to discard that.
Quick update, it was a silly mistake. Apologies on the slow pace as I'm doing my best mainly on the night on the few spare minutes I have this week, I'm exhausted at the end of the day and I end making this mistakes haha.
My estimation is to have a working solution tomorrow for everyone to test it.
Quick update, it was a silly mistake. Apologies on the slow pace as I'm doing my best mainly on the night on the few spare minutes I have this week, I'm exhausted at the end of the day and I end making this mistakes haha.
My estimation is to have a working solution tomorrow for everyone to test it.
Don't worry, we appreciate your efforts!
Thanks @cjaliaga !!
I have a working version, and I'm sure it will require some refactor but I think the best way is for us to test it and find the edge cases (and maybe not that edge haha) while using it so I'll release a new version with the changes.
I am getting this:
'<' not supported between instances of 'datetime.datetime' and 'NoneType' Cannot connect to host authglb.digital.panasonic.comhttps:443 ssl:default [Name or service not known] Cannot connect to host authglb.digital.panasonic.comhttps:443 ssl:default [Name or service not known] Cannot connect to host authglb.digital.panasonic.comhttps:443 ssl:default [Name or service not known] Cannot connect to host authglb.digital.panasonic.comhttps:443 ssl:default [Name or service not known] Cannot connect to host authglb.digital.panasonic.comhttps:443 ssl:default [Name or service not known] Cannot connect to host authglb.digital.panasonic.comhttps:443 ssl:default [Name or service not known]
@jp-embedded the first error should have been fixed in 0.7.1
The other ones authglb.digital.panasonic.comhttps:443 ssl:default [Name or service not known] Cannot connect to host
I think are a result of some request failing breaking the auth flow, and hence the location header resolves to a full URL instead of a path, like here:
I'll add verifications in between requests and more logging soon.
0.7.1 works for me. Thank you so much <3
Thanks. Fix was faster then heishamon delivery. Just one issue for me: After around 24 hours of updating all entities turned unavailable. Reloading integration fixed it
Same issue happened to me as it did for @vukisz. Entities were unavailable until I reloaded the integration. Now is working fine.
Working! Thanks!
I have a theory about why it didn't try to refresh the data, I think is due to token expiratio and some assumption I took for granted. I'll try to release a hotfix later today.
Just merged #47 that should fix the refresh issue. Publishing 0.7.2 with the fix.
0.7.1 works fine for me. Thanks for the work you've put into!
March 18 around 00 UTC authentication to aquarea-smart.panasonic.com started failing. likely due to API change?
https://github.com/cjaliaga/home-assistant-aquarea/issues/105
I believe our connection string looks like this? any request to this enpoint seems to result in the same error/403:
FWIW - I was able to see web login process to https://authglb.digital.panasonic.com/usernamepassword/login, don't have a setup for sniff the mobile app atm: