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

Error with a user during authentication #7

Open
albaintor opened this issue Feb 14, 2024 · 6 comments
Open

Error with a user during authentication #7

albaintor opened this issue Feb 14, 2024 · 6 comments

Comments

@albaintor
Copy link

Hi @Woyken ,

I have received this issue from a user albaintor/homeassistant_electrolux_status#28 (comment)

The error comes gigyaClient. I am not really aware of its goal, it seems to extract info based on the user region ?

File "/config/custom_components/electrolux_status/electroluxwrapper/gigyaClient.py", line 147, in get_ids
data: SocializeGetIdsResponse = await response.json(content_type=None)

Thank you for your help

@albaintor albaintor changed the title Error with a user during Error with a user during authentication Feb 14, 2024
@Woyken
Copy link
Owner

Woyken commented Feb 14, 2024

Hey, it's probably responding with some error status code.
Can you try updating the library, I recently updated it to throw on status code error from Gigya.
I found out reading their documentation that there is a header you pass in to either always return status 200 or allow "normal error" status codes too.

I noticed you are using copied older version that always expects success.
If you update we might get some more details on what is happening

@Woyken
Copy link
Owner

Woyken commented Feb 14, 2024

Although it looks like it can't parse Json, either response body is not valid Json or is empty, so I'm not sure if it'll help. I'll try some different requests, what the response could be in few hours on my side

@albaintor
Copy link
Author

Hi,
The response is empty in this case from the logs :
"File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None"

@Woyken
Copy link
Owner

Woyken commented Feb 14, 2024

Looks like I had GET and POST requests mixed up for get_ids() gigya request, not sure why it even worked sometimes.
Fixed that. Also added a bunch more error logging. If request fails to parse JSON. will output what ever it received as text(), and a bunch more stuff, should be easier to spot the problem.

Released version: 0.0.12

@albaintor
Copy link
Author

Ok thank you. You also changed the user agent to make the request always pass ?
I will then switch back to an external dependency instead of wrapping it

@Woyken
Copy link
Owner

Woyken commented Feb 15, 2024

Yes, I added user agent header: "pyelectroluxocp/VERSION"

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

2 participants