pymyq icon indicating copy to clipboard operation
pymyq copied to clipboard

Update auth headers and payload to get around 401s

Open thevickypedia opened this issue 1 year ago • 17 comments

thevickypedia avatar Oct 12 '23 01:10 thevickypedia

This worked for me. Thank you! I was getting these 401 errors previously:

Authentication failed: Error requesting data from https://partner-identity.myq-cloud.com/connect/token: 401 - Unauthorized
There was an error: %s Error requesting data from https://partner-identity.myq-cloud.com/connect/token: 401 - Unauthorized

simmonyau avatar Oct 12 '23 03:10 simmonyau

This also fixed the problem for me.

marcone avatar Oct 13 '23 05:10 marcone

lgtm, to test:

 pip uninstall pymyq
 pip install git+https://github.com/arraylabs/pymyq.git@refs/pull/188/head

Tahlor avatar Oct 14 '23 23:10 Tahlor

If this works, can this be merged?

jschwalbe avatar Oct 23 '23 01:10 jschwalbe

@jschwalbe unfortunately I don't have write access to merge it @ehendrix23 please review this PR and merge it

thevickypedia avatar Oct 23 '23 01:10 thevickypedia

It worked for a few days, now I'm getting 429 errors (cloudflare related). You still probably want to merge this, but more work is needed.

https://github.com/Python-MyQ/Python-MyQ/issues/24#issuecomment-1774208488

Tahlor avatar Oct 23 '23 01:10 Tahlor

It worked for a few days, now I'm getting 429 errors (cloudflare related). You still probably want to merge this, but more work is needed.

Python-MyQ/Python-MyQ#24 (comment)

Same here....I plan to move to ratgdo to not rely on myq cloud infra

simmonyau avatar Oct 25 '23 16:10 simmonyau

I just tested today and I started getting authentication errors More information: https://community.home-assistant.io/t/the-current-state-of-myq-from-the-codeowner/630623

thevickypedia avatar Oct 25 '23 16:10 thevickypedia

Can someone ELI5 why whatever the official myQ app does to authenticate can't be replicated in pymyq? The Google Play store tells me the Android myQ app hasn't been updated in over a month, so it doesn't seem like Chamberlain were actively changing things on the dates mentioned in the timeline in that forum post.

marcone avatar Oct 26 '23 16:10 marcone

The app could have been changed months ago, and only the servers updated recently.

FlyingDiver avatar Oct 26 '23 16:10 FlyingDiver

My point was that there were multiple pymyq fixes followed by renewed breakages since the last app update, while the app just kept working. Even in the unlikely case that Chamberlain predicted all of pymyq's attempts at fixes and had new server tweaks ready to block them, the fact is still that the app kept working throughout all this, so whatever is the correct authentication method has been in the app since at least September 22 (I'm using the Android app, which was last updated on 9/22 according to the Play Store).

(I know nothing about authentication protocols, I'm just curious if there's a technical reason why pymyq can't do whatever the app does. Shouldn't it be possible for pymyq to basically pretend to be the app, with Chamberlain's servers none the wiser?)

marcone avatar Oct 26 '23 16:10 marcone

That's what the (many) fixes for the 401 errors have been doing. And don't forget - it's certainly possible for the protocols used by the app to be updated from the MyQ servers without an app update through the Play store.

OTOH, none of this will fix the 429 errors.

FlyingDiver avatar Oct 26 '23 16:10 FlyingDiver

I think it's time to give up on MyQ integrations https://chamberlaingroup.com/press/a-message-about-our-decision-to-prevent-unauthorized-usage-of-myq

thevickypedia avatar Nov 27 '23 21:11 thevickypedia

Old news. Everyone else has already abandoned it. I'm going to be installing a ratgdo this week and integrating it.

FlyingDiver avatar Nov 27 '23 21:11 FlyingDiver

I was just catching up, I was naively trying to fix it by sniffing packets using the MyQ mobile app but no luck Even my plan is to install a ratgdo by EOY

thevickypedia avatar Nov 27 '23 21:11 thevickypedia

I back-ordered 3 ratgdo devices on October 25th and still have not received them unfortunately 😔

simmonyau avatar Nov 27 '23 22:11 simmonyau

I ended up using ifttt to at least be able to close the garage doors through myq with an ifttt maker webhook until I am able to receive my ratgdo devices.

simmonyau avatar Nov 27 '23 22:11 simmonyau