QuickSander / homebridge-mieleathome

Apache License 2.0
37 stars 7 forks source link

Unable to retrieve Token from Miele #18

Closed ixs closed 3 years ago

ixs commented 3 years ago

With 2.5.2 the Miele URL is incorrectly formed and does not contain the port for the authorization grant server.

What gets opened in another window:

https://api.mcs3.miele.com/thirdparty/login?client_id=[redacted]&response_type=code&redirect_uri=http://192.168.1.109/auth_grant&state=[redacted]

This redirects back to the main homebridge ui window and will not pass the token.

If manually changing the URL in the newly opened window to https://api.mcs3.miele.com/thirdparty/login?client_id=[redacted]&response_type=code&redirect_uri=http://192.168.1.109:8582/auth_grant&state=[redacted] the redirect suceeds and the authentication tokens are taken.

QuickSander commented 3 years ago

I believe this is unrelated to 2.5.2, but it is related to the situation when your main Homebridge UI does not run on a port other than port 80.

Thanks for the notification, I will take this along in the next release.

ixs commented 3 years ago

I'm not certain it's a new thing in 2.5.2, might be older. It's just that I used the plugin in 2.5.2 for the first time.

I was running this on the latest and greatest raspian homebridge image from https://github.com/homebridge/homebridge-raspbian-image/releases/tag/v1.0.19.

That has the UI running on port 80. But the redirect just ends up on the main page of the ui. If I add the specified port to the URL manually, the window that is opening is the auth token collector from the plugin...

QuickSander commented 3 years ago

v2.6.0 should fix this.

ixs commented 3 years ago

Looking good indeed. Thanks for the quick fix.