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

Login error Gigya #29

Closed
techillin opened this issue Oct 9, 2024 · 6 comments
Closed

Login error Gigya #29

techillin opened this issue Oct 9, 2024 · 6 comments

Comments

@techillin
Copy link

Are we supposed to still use the same Electrolux account or are there any changes in that regards concerning the switch to gigya?

~ $ python3 -m purei9_unofficial -d -o json cloud -v3 -c "MyElectroluxUsername:MyElectroluxPassword" status
2024-10-09 10:57:03,527 - purei9_unofficial.util - DEBUG - HTTP POST https://socialize.us1.gigya.com/socialize.getIDs
2024-10-09 10:57:03,538 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): socialize.us1.gigya.com:443
2024-10-09 10:57:03,776 - urllib3.connectionpool - DEBUG - https://socialize.us1.gigya.com:443 "POST /socialize.getIDs HTTP/11" 200 365
2024-10-09 10:57:03,779 - purei9_unofficial.util - DEBUG - HTTP 200 <Response [200]> (sensitive data not shown)
2024-10-09 10:57:03,780 - purei9_unofficial.util - DEBUG - HTTP POST https://accounts.us1.gigya.com/accounts.login
2024-10-09 10:57:03,787 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): accounts.us1.gigya.com:443
2024-10-09 10:57:04,228 - urllib3.connectionpool - DEBUG - https://accounts.us1.gigya.com:443 "POST /accounts.login HTTP/11" 200 211
2024-10-09 10:57:04,230 - purei9_unofficial.util - DEBUG - HTTP 200 <Response [200]> {
  "callId": "1e18a241e0224f899c58c0e397a107e3",
  "errorCode": 403042,
  "errorDetails": "invalid loginID or password",
  "errorMessage": "Invalid LoginID",
  "apiVersion": 2,
  "statusCode": 403,
  "statusReason": "Forbidden",
  "time": "2024-10-09T08:57:04.167Z"
}
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/__main__.py", line 164, in <module>
    robots = client.getRobots()
             ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/cloudv3.py", line 251, in getRobots
    r = do_http("GET", self.apiurl + "/appliances", headers=self._getHeaders())
                                                            ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/cloudv3.py", line 224, in _getHeaders
    idToken, countryCode = gigya_login(self.username, self.password)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/cloudv3_gigya.py", line 127, in gigya_login
    gigya_country = data["profile"]["country"]
                    ~~~~^^^^^^^^^^^
KeyError: 'profile'
@Phype
Copy link
Owner

Phype commented Oct 11, 2024

It should be the same, for me it worked without doing anything in homeassistant.

But there might be differences depending on the region where your account is registered and/or if it's supposed to be an AEG or Electrolux account. I mostly just copied the requests which the app did in my case.

@Phype
Copy link
Owner

Phype commented Oct 11, 2024

One thing you can do without breaking the official app's TLS connection is check if the requests are also going to the "us1.gigya.com" domain. This information should be contained in the TLS handshakes in plaintext of you sniff on the network while logging into the account with the app. Maybe they are using different zones, i.e. for users based in Europe vs. US, because of privacy protection regulation and stuff like that.

@joakimjalden
Copy link

joakimjalden commented Oct 21, 2024

This information should be contained in the TLS handshakes in plaintext of you sniff on the network while logging into the account with the app.

When I am logging into the Electrolux app (with an Electrolux account) from Sweden (EU) on an iPhone I am now asked to "continue with" either Google, Apple, or Email (all represented by symbols). When choosing the Email symbol the app asks for the account email and once given sends a 6 digit code to the email address. This code is then used to log in. It never requests the account password. The TLS Client Hellos are sent to api.eu.ocp.electrolux.oneand ws.eu.ocp.electrolux.one. Seems to be quite a different login procedure over all to what you have in the US.

@joakimjalden
Copy link

A bit too quick in my note. There are also TLS Client Hellos to socialize.eu1.gigya.com and accounts.eu1.gigya.com, so maybe it is not so different after all.

@joakimjalden
Copy link

joakimjalden commented Oct 21, 2024

Also, just to confirm, I get the same error message as @techillin. Changing all us1 to eu1 in cloudv3_gigya.py results in

2024-10-21 19:41:51,021 - purei9_unofficial.util - DEBUG - HTTP 200 <Response [200]> {
  "callId": "c5d4c2a2e39d47aea0cd1c722a96d4a5",
  "errorCode": 301001,
  "errorDetails": "This API key is served by another data center.",
  "errorMessage": "Invalid data center",
  "apiVersion": 2,
  "statusCode": 301,
  "statusReason": "Moved Permanently",
  "time": "2024-10-21T17:41:51.001Z",
  "apiDomain": "us1.gigya.com",
  "location": "https://accounts.us1.gigya.com/accounts.login"
}

@Phype
Copy link
Owner

Phype commented Oct 29, 2024

Fixed in version 0.0.16. The country needs to be passed seperately.

@Phype Phype closed this as completed Oct 29, 2024
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

3 participants