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 403 Error not a valid key=value pair (missing equal-sign) in Authorization header: #28

Closed
techillin opened this issue Aug 3, 2024 · 3 comments

Comments

@techillin
Copy link

~ # python3 -m purei9_unofficial -d -o json cloud -v3 -c "XXXXXX:XXXXXXX" status
2024-08-03 12:27:06,778 - purei9_unofficial.util - DEBUG - HTTP POST https://api.ocp.electrolux.one/one-account-authorization/api/v1/token
2024-08-03 12:27:06,783 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.ocp.electrolux.one:443
2024-08-03 12:27:06,933 - urllib3.connectionpool - DEBUG - https://api.ocp.electrolux.one:443 "POST /one-account-authorization/api/v1/token HTTP/11" 200 809
2024-08-03 12:27:06,938 - purei9_unofficial.util - DEBUG - HTTP 200 <Response [200]> (sensitive data not shown)
2024-08-03 12:27:06,940 - purei9_unofficial.util - DEBUG - HTTP POST https://api.ocp.electrolux.one/one-account-authentication/api/v1/authenticate
2024-08-03 12:27:06,950 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.ocp.electrolux.one:443
2024-08-03 12:27:07,071 - urllib3.connectionpool - DEBUG - https://api.ocp.electrolux.one:443 "POST /one-account-authentication/api/v1/authenticate HTTP/11" 403 1582
2024-08-03 12:27:07,073 - purei9_unofficial.util - DEBUG - HTTP 403 <Response [403]> {"message":"'eyJraWQiOiIxMGZhMWQwOWY4YjM2OGFjYmE4YmRiNDYxOTFmZmVhODE1MmZiM2YzZjQ5N2RhZjk1OWFjNWIzNDM5ZDI3OGY0IiwiYWxnIjoiUlMyNTYiLCJ0eXAiOiJKV1QifQ.eyJpYXQiOjE3MjI2ODA4MjYsImlzcyI6Imh0dHBzOi8vYXBpLm9jcC5lbGVjdHJvbHV4Lm9uZS9vbmUtYWNjb3VudC1hdXRob3JpemF0aW9uIiwiY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ETgZNQ0E5M61Na9Y3pj83thhdHggY2rYG13MXH2i5jjKcK3Zzz5Jm0QIJmpd-DYV29ZOqNKZIl-f_Ee3QdE9gDuVto1uyPATePAHtZ1WXMuQIe2zvF6RXgvbhEMjlImHzzMT69KVXEG73gfYePHojct7piTJzBfJFNeDWbzEAqovsBWiybcBKsEcToOD_8FnkuqG-ZP1vEBOplg'."}
2024-08-03 12:27:07,073 - purei9_unofficial.util - DEBUG - HTTP POST https://api.ocp.electrolux.one/one-account-authentication/api/v1/authenticate
2024-08-03 12:27:07,077 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.ocp.electrolux.one:443
2024-08-03 12:27:07,193 - urllib3.connectionpool - DEBUG - https://api.ocp.electrolux.one:443 "POST /one-account-authentication/api/v1/authenticate HTTP/11" 403 1582
2024-08-03 12:27:07,194 - purei9_unofficial.util - DEBUG - HTTP 403 <Response [403]> {"message":"'eyJraWQiOiIxMGZhMWQwOWY4YjM2OGFjYmE4YmRiNDYxOTFmZmVhODE1MmZiM2YzZjQ5N2RhZjk1OWFjNWIzNDM5ZDI3OGY0IiwiYWxnIjoiUlMyNTYiLCJ0eXAiOiJKV1QifQ.eyJpYXQiOjE3MjI2ODA4MjYsImlzcyI6Imh0dHBzOi8vYXBpLm9jcC5lbGVjdHJvbHV4Lm9uZS9vbmUtYWNjb3VudC1hdXRob3JpemF0aW9uIiwiYXVkIjoiaHR0cHM6Ly9hcGkub2NwLmVsZWN0cm9sdXgub25lIiwiZXhwIjoxNzIyNzI0MDI2LCJzdWIiOiJFbHhPbmVBcHAiLCJhenAiOiJFbHhPbmVBcHAiLCJzY29wZSI6IiIsIm9jYyI6bnVsbH0.Ch6hp-POAv4uNO0shn6zJDy1a2oWJ3sEsnW2z-Pc8h81JeInFwm7mGSvzzaUS9-4VNqM6UAFIqIhBWUt5McJ58SY4teJhKIAnRvPmI9RnDABLDdQVl7g-MpnzxGcftUqjrmyVklETgZNQ0E5M61Na9Y3pj83thhdHggY2rYG13MXH2i5jjKcK3Zzz5Jm0QIJmpd-DYV29ZOqNKZIl-f_Ee3QdE9gDuVto1uyPATePAHtZ1WXMuQIe2zvF6RXgvbhEMjlImHzzMT69KVXEG73gfYePHojct7piTJzBfJFNeDWbzEAqovsBWiybcBKsEcToOD_8FnkuqG-ZP1vEBOplg' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer eyJraWQiOiIxMGZhMWQwOWY4YjM2OGFjYmE4YmRiNDYxOTFmZmVhODE1MmZiM2YzZjQ5N2RhZjk1OWFjNWIzNDM5ZDI3OGY0IiwiYWxnIjoiUlMyNTYiLCJ0eXAiOiJKV1QifQ.eyJpYXQiOjE3MjI2ODA4MjYsImlzcyI6Imh0dHBzOi8vYXBpLm9jcC5lbGVjdHJvbHV4Lm9uZS9vbmUtYWNjb3VudC1hdXRob3JpemF0aW9uIiwiYXVkIjoiaHR0cHM6Ly9hcGkub2NwLmVsZWN0cm9sdXgub25lIiwiZXhwIjoxNzIyNzI0MDI2LCJzdWIiOiJFbHhPbmVBcHAiLCJhenAiOiJFbHhPbmVBcHAiLCJzY29wZSI6IiIsIm9jYyI6bnVsbH0.Ch6hp-POAv4uNO0shn6zJDy1a2oWJ3sEsnW2z-Pc8h81JeInFwm7mGSvzzaUS9-4VNqM6UAFIqIhBWUt5McJ58SY4teJhKIAnRvPmI9RnDABLDdQVl7g-MpnzxGcftUqjrmyVklETgZNQ0E5M61Na9Y3pj83thhdHggY2rYG13MXH2i5jjKcK3Zzz5Jm0QIJmpd-DYV29ZOqNKZIl-f_Ee3QdE9gDuVto1uyPATePAHtZ1WXMuQIe2zvF6RXgvbhEMjlImHzzMT69KVXEG73gfYePHojct7piTJzBfJFNeDWbzEAqovsBWiybcBKsEcToOD_8FnkuqG-ZP1vEBOplg'."}
2024-08-03 12:27:07,194 - purei9_unofficial.util - DEBUG - HTTP POST https://api.ocp.electrolux.one/one-account-authentication/api/v1/authenticate
2024-08-03 12:27:07,198 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.ocp.electrolux.one:443
2024-08-03 12:27:07,319 - urllib3.connectionpool - DEBUG - https://api.ocp.electrolux.one:443 "POST /one-account-authentication/api/v1/authenticate HTTP/11" 403 1582
2024-08-03 12:27:07,321 - purei9_unofficial.util - DEBUG - HTTP 403 <Response [403]> {"message":"'eyJraWQiOiIxMGZhMWQwOWY4YjM2OGFjYmE4YmRiNDYxOTFmZmVhODE1MmZiM2YzZjQ5N2RhZjk1OWFjNWIzNDM5ZDI3OGY0IiwiYWxnIjoiUlMyNTYiLCJ0eXAiOiJKV1QifQ.eyJpYXQiOjE3MjI2ODA4MjYsImlzcyI6Imh0dHBzOi8vYXBpLm9jcC5lbGVjdHJvbHV4Lm9uZS9vbmUtYWNjb3VudC1hdXRob3JpemF0aW9uIiwiYXVkIjoiaHR0cHM6Ly9hcGkub2NwLmVsZWN0cm9sdXgub25lIiwiZXhwIjoxNzIyNzI0MDI2LCJzdWIiOiJFbHhPbmVBcHAiLCJhenAiOiJFbHhPbmVBcHAiLCJzY29wZSI6IiIsIm9jYyI6bnVsbH0.Ch6hp-POAv4uNO0shn6zJDy1a2oWJ3sEsnW2z-Pc8h81JeInFwm7mGSvzzaUS9-4VNqM6UAFIqIhBWUt5McJ58SY4teJhKIAnRvPmI9RnDABLDdQVl7g-MpnzxGcftUqjrmyVklETgZNQ0E5M61Na9Y3pj83thhdHggY2rYG13MXH2i5jjKcK3Zzz5Jm0QIJmpd-DYV29ZOqNKZIl-f_Ee3QdE9gDuVto1uyPATePAHtZ1WXMuQIe2zvF6RXgvbhEMjlImHzzMT69KVXEG73gfYePHojct7piTJzBfJFNeDWbzEAqovsBWiybcBKsEcToOD_8FnkuqG-ZP1vEBOplg' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer eyJraWQiOiIxMGZhMWQwOWY4YjM2OGFjYmE4YmRiNDYxOTFmZmVhODE1MmZiM2YzZjQ5N2RhZjk1OWFjNWIzNDM5ZDI3OGY0IiwiYWxnIjoiUlMyNTYiLCJ0eXAiOiJKV1QifQ.eyJpYXQiOjE3MjI2ODA4MjYsImlzcyI6Imh0dHBzOi8vYXBpLm9jcC5lbGVjdHJvbHV4Lm9uZS9vbmUtYWNjb3VudC1hdXRob3JpemF0aW9uIiwiYXVkIjoiaHR0cHM6Ly9hcGkub2NwLmVsZWN0cm9sdXgub25lIiwiZXhwIjoxNzIyNzI0MDI2LCJzdWIiOiJFbHhPbmVBcHAiLCJhenAiOiJFbHhPbmVBcHAiLCJzY29wZSI6IiIsIm9jYyI6bnVsbH0.Ch6hp-POAv4uNO0shn6zJDy1a2oWJ3sEsnW2z-Pc8h81JeInFwm7mGSvzzaUS9-4VNqM6UAFIqIhBWUt5McJ58SY4teJhKIAnRvPmI9RnDABLDdQVl7g-MpnzxGcftUqjrmyVklETgZNQ0E5M61Na9Y3pj83thhdHggY2rYG13MXH2i5jjKcK3Zzz5Jm0QIJmpd-DYV29ZOqNKZIl-f_Ee3QdE9gDuVto1uyPATePAHtZ1WXMuQIe2zvF6RXgvbhEMjlImHzzMT69KVXEG73gfYePHojct7piTJzBfJFNeDWbzEAqovsBWiybcBKsEcToOD_8FnkuqG-ZP1vEBOplg'."}
2024-08-03 12:27:07,321 - purei9_unofficial.util - ERROR - Giving up due to no left retries. Wrong credentials?
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/util.py", line 22, in do_http
    r.raise_for_status()
  File "/usr/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.ocp.electrolux.one/one-account-authentication/api/v1/authenticate

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/util.py", line 22, in do_http
    r.raise_for_status()
  File "/usr/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.ocp.electrolux.one/one-account-authentication/api/v1/authenticate

During handling of the above exception, another exception occurred:

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 227, in _getHeaders
    r = do_http("POST", self.authenticationurl + "/authenticate", json={"username":self.username, "password": self.password}, headers={"Authorization": "Bearer " + self.token["accessToken"],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/util.py", line 26, in do_http
    return do_http(method, url, retries-1, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/util.py", line 26, in do_http
    return do_http(method, url, retries-1, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/util.py", line 29, in do_http
    raise r
  File "/usr/lib/python3.12/site-packages/purei9_unofficial/util.py", line 22, in do_http
    r.raise_for_status()
  File "/usr/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.ocp.electrolux.one/one-account-authentication/api/v1/authenticate
~ #

@Phype
Copy link
Owner

Phype commented Aug 6, 2024

Yes, i have the same problem, but I'll not be able to fix it for the next 2 weeks. Another home assistant integration has experienced the same and there is now an official Electrolux API available. See:

@JohNan
Copy link

JohNan commented Aug 6, 2024

Thanks for referencing to my library @Phype
I have just pushed a rough first version of it. https://pypi.org/project/pyelectroluxgroup/0.1.0/

Try it out and open an issues or a pull request at the repository if any changes is needed.

@Phype
Copy link
Owner

Phype commented Oct 4, 2024

I've fixed the Login in version 0.0.15 by implementing their new authenticaion which is based on SAP gigya.

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