grzegorz914 / homebridge-xbox-tv

Homebridge plugin for Microsoft Game Console, publish as independent external platform accessory.
MIT License
164 stars 15 forks source link

How often to re-authorize the console? #177

Closed angeloghisi closed 1 year ago

angeloghisi commented 1 year ago

Hi, the plug-in works quite well.

However I have a question: how often do I need to re-authorize the console? I mean: sometimes it works for weeks and I can turn my Xbox on from Home app without any problem. Sometimes after a couple of days I try to turn my Xbox on and it’s not working. When I open HomeBridge interface I find out that the plug-in needs to be re-authorized.

How often does the plug-in need a new API token? Is there a way to be able to get a notification when the plug-in needs a new authorization? This would be useful to avoid plug-in malfunctions (that in fact are not plug-in malfunctions but need for authorization).

thank you very much

grzegorz914 commented 1 year ago

To reautgorize console Just Clear Web API Token and start authorization again.

Captainkyle420 commented 1 year ago

angeloghisi, I am having the same issue. It used to give an option to stay signed in. But doesn’t anymore. I am trying a to work around it. Seeing if I log out of Microsoft & clear sign in cookies on my browser (on the device I am using the home bridge gui on) then sign in before I use the Xbox tv authorize manager. And select stay signed in then login with the Xbox authorization manager. And will see if the stay signed in carries over. Will keep you posted

angeloghisi commented 1 year ago

@grzegorz914 yes I know how authorization works, I do it every time the authorization expires. My question was: is there a way to avoid authorization expiration or at least being notified if it’s expired? Sometimes I get home, I want to turn my Xbox on and it does not work… I have to open HomeBridge interface and go through the entire process of re-authorization. Nothing serious, but I thought it would be nice asking.

Thanks for your work

angeloghisi commented 1 year ago

@Captainkyle420 ok thank you very much, let me know if you find out something new

torandreroland commented 1 year ago

I'm having the same problem with the need for reauthentication. This is especially unfortunate since this plugin eventually consumes all resources on the machine (see issue #172).

I'm thinking there is room for improvement here with how this plugin handles tokens. Without looking into how the plugin handles authentication and authorization, but assuming it's based on OIDC and OAuth 2.0, the plugin should use an authorization flow that lets it refresh an access token based on a refresh token, thus bypassing the need to authenticate again.

grzegorz914 commented 1 year ago

Will be fixed ASAP.

grzegorz914 commented 1 year ago

Please check latest beta and let me know.

muzzymate commented 1 year ago

Thank you. Just installed latest beta and will report back. Was having same issue where I was constantly loosing authorization.

shanemcw commented 1 year ago

Running beta; not sure if this is related, but got this error several times:

[6/27/2023, 9:17:34 AM] [XboxTv] Device: 192.168.0.25 Xbox, set Power, error: send command type: Power, command: WakeUp, params: undefined, error: {"status":404,"body":"{\r\n  \"status\": {\r\n    \"errorCode\": \"ErrorCallingWNS\",\r\n    \"errorMessage\": \"Send command failed\"\r\n  },\r\n  \"result\": null,\r\n  \"uiText\": null,\r\n  \"destination\": null,\r\n  \"userInfo\": null,\r\n  \"opId\": \"ea14c11c-6eee-43ba-bc29-b0a5eaf7cdda\"\r\n}"}
[6/27/2023, 9:17:41 AM] [XboxTv] Device: 192.168.0.25 Xbox, set Power: OFF
grzegorz914 commented 1 year ago

@shanemcw this error have nothing to do with, if you see this error always open new issue pleas.

angeloghisi commented 1 year ago

The last beta is working for some days now, no need to re-authorize at the moment.

I’ll keep you updated in the next days.

thank you