-
Notifications
You must be signed in to change notification settings - Fork 15
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
GB invalid token #136
Comments
I am seeing this too. Some restarts work, but not all. The following in my DEBUG logs reveals what is happening...
When the box has been switched off, and then turns on, it gets a "401-Unauthorise error" from the API. So it reconnects using the refresh token, and this generates a new refresh token - but we are not catching the new token, and updating the config. I am testing a fix in my development environment. If the test goes well, I will make a PR tomorrow evening. |
My "fix" didn't work, as it generated a new error.
Going to have to do some reading of the HA docs on how to avoid that. |
I am struggling to find a solution to this, my python skills are not good enough. To solve the issue, I need to call
However, this generates the error
so I have read the HA docs, and tried
same error. Then tried
gives an error that data is undefined (which it is, is an attribute of Finding another HA doc, I then tried moving it to a separate function and adding Each try, requires leaving my environment running for 5-6 hours until the virgin timeout occurs, and triggers the error. ... frustrating... |
Interestingly, only one of my boxes is showing as 'available'. The other one is stuck at unavailable |
Sorry, I've only got one box, so can't help there. Silly question - are both boxes switched on? Is there anything in the logs? |
When it worked, both my boxes were functional |
I suggest we fix this issue first, then see where we have got to with multiple boxes. |
Eureka, I think I've found a way round the threading issue. |
If it helps I have a "spare" Pi that I can put HA onto for testing? |
The two pull requests above should resolve this issue. In 24hr testing, I've seen two new tokens come through, and the stored configuration details updated. |
Thanks - let’s see how the fix goes. I now in that “it works for me” situation - now need to see if it works for everyone else. If there are further issues, I may need more data points from other people. |
Sorry all, noob here. Should the cookie refresh issue be fixed in an update. Struggling to receive any update via hacs? |
If you're having the same issue, a future update containing Colin's changes should fix it. Not sure on when that would be, waiting on the changes being pulled to the main version. |
Hi Hampo, You said in your first post above that: "After setting up a GB account following the new JWT steps, it errors after a HA reboot" What are the new JWT steps you are referring to when setting up a GB account? Is there a link you could provide with instructions on how to do this please? Regards, Matthew |
@gunionbag probably worth holding off until the next update which fixes this issue, but the configuration steps are in the README: https://github.com/Sholofly/lghorizon/blob/dev/README.md#configuration-for-virgin-gb |
@Hampo Thanks for getting back to me so quickly. I was trying to retrieve the JWT token yesterday as per those instructions but was unable to. So I wasn't sure if the bug you had reported was responsible for that or whether I wasn't doing something right when trying to retrieve the token. I originally tried to get the token using the extension in Chrome, but that didn't work, neither did Edge. But I was able to retrieve the token using Firefox. As you suggested, I'll hold off until the next update before trying this again. But at least now I know how to get the token. Thanks for your help. |
As a temporary workaround until @Sholofly is able to integrate the fix into the official HACS version, if anyone using Hass OS want to try the fix, the following install process worked for me. The instructions assume you have already downloaded a version of LG Horizon via HACS. Use at your own risk - getting a command wrong could destabilise your HA installation. Take a FULL HA backup first.
(The last
This worked for me, but no guarantees it will work for you. If you are not familiar with Linux, and not sure what the commands above do, then I strongly urge waiting until the official release via HACS. BackoffIf all goes wrong, you should be able to backoff the changes by going to HACS, finding the LG Horizon entry, and select the "redownload" option. This should reinstate the HACS version (if I have understood how HACS works correctly). When the official HACS update to LG Horizon is made, it should download automatically and overwrite these changes. Disclaimers
|
@ColinRobbins Thanks Colin, I'll give it a try and post back my results. After you enter your LG Horizon login details and token, how long should it take for the login process to finish, assuming it works? |
@gunionbag a few seconds. |
@gunionbag In my experience of the current configuration, when you have all the details correct it's a matter of seconds before it's successful. That is, after a HA restart it takes me a few minutes to get the new token via Firefox and enter all details and I'm back up and running. If it takes a bit longer I'd suggest you check all the details and especially that you have all of the token. Which I didn't do when I tried to get the tokens when @ColinRobbins found this method. |
@ChrisThomas42 Just to confirm, that is now working. The issue I had was that I wasn't selecting "flutter._WEB_SECURE_STORAGE_refreshToken" from the dropdown at the top of the JWT extension, as per the attached screenshot in case that helps anyone else. @ChrisThomas42 and @ColinRobbins - Thank you both for your help, much appreciated. |
Apologies, I should have also thanked @Sholofly for developing this integration in the first place - thanks. |
No problem @gunionbag ;) I've released a new version. Please keep me posted on the results! |
Big thank you to Sholofly for this new version - Its installed and working perfectly, great job.. |
Thanks @xtruss but the credits are mostly for @ColinRobbins since he did the important part of the job! |
Thanks very much to everyone involved, @Sholofly @ColinRobbins Query - after a HA restart I assume I need to update the JWT token right? |
@Shivy011, the whole point of the fix is the token should survive an HA restart. The token has a 2 month lifetime, but is refreshed every time HA restarts or the Virgin box is restarted. By grabbing the token from a browser, we are effectively hijacking the web session and the token used by the web browser. My experience is every time you re-load the web page, it refreshes the token without the need to logon again. This is also the mechanism used by the My Virgin GO app, which seems to stay logged on for a long time. Occasionally I need to re-authenticate the My Virgin GO app - not quite sure of the trigger - there could be some, other kind of timeout lurking. Time will tell. But is should work for several months, with HA restarts, without issue. |
Describe the bug
After setting up a GB account following the new JWT steps, it errors after a HA reboot
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It to work
Screenshots
N/A
Version of the component
v0.6.2
Logging
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: