-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Unable to log in with login-cookie #93
Comments
The latest version of the bridge has only been out for a month 🤔 Getting logged out periodically is expected on google workspace accounts because they do that on the website too. Relogin is supposed to work right away, but there could be some state issues that require restarting before it works |
That's 1½ year in total, I've been pulling updates along the way :) It has stayed connected tho, with a "silent" logout a month ago after which Also, to clarify - I did not have to login to Google again, chat.google.com loads right away, but the json cookie assembled from the cookies from the working site is no longer being accepted. |
I've been experiencing the same behavior since the weekend (which is when I Logged in on Saturday 8th at 17:22 UTC, got kicked out Tuesday at 18:50, after Yesterday I deleted all my Google cookies, and was able to connect the bridge Connected the googlechat bridge at 17:02, got kicked out again at 17:16. Didn't
Thought maybe my server's IP had gotten on a blacklist or something since I saw Logged in at 18:59 (after clearing my Google cookies again and getting new
|
If you keep the browser window used for login open, it will definitely break, that's why the instructions say to use a private window. Old cookies also obviously won't work, if they did the bridge wouldn't have got logged out |
I don't recall doing this in the past, but tried now and that cookie was accepted. Hopefully it stays connected :) The instructions in the bridge ( |
Alright, that explains it then - thank you. I wanted to check that all events were coming through, which only served to make matters worse. As @noccy80 writes, there was no mention of this in the help text from the bot - someone can probably PR a fix for that. In both docs and the bot help text I would suggest elaborating on why the private browser window is needed though (perhaps as a footnote in the authentication instructions and just link to it from the bot help text?). |
So I logged in to chat.google.com again on Friday, in a private browser window in Firefox as per the instructions this time [1]. Copied out the details for the bridge login cookie and closed the window in advance, to not have it sit around and break the session this time. Connected the bridge at 14:20 UTC, got kicked out again at 18:32 with the exact same error as pasted twice in my earlier comment. To make really sure I didn't inadvertently mess up something, I decided to take the isolation a couple steps further before commenting here again. I went on my laptop (which sleeps on weekends) and opened Chrome (which I don't use), and then logged into chat.google.com in a private window there. Copied cookie details out, quit Chrome, and put the laptop back to sleep. Connected the bridge again at 18:54, and it stayed logged in (except for a couple of reconnections) until Sunday at 9:49 at which point I got kicked out again. Of both the bridge and all my browser sessions. Trying to log in to mail again on my PC, I was presented with this:
Was forced to change my password, which was pretty annoying, and then relogin for browser based sessions with 2FA. Now, I can't 100% prove that this was the bridge getting flagged as "suspicious" because the details Google provide are absolutely useless: but I would be very surprised if it was anything else, given that I haven't been up to anything else "exciting" with my Google account, and my only Windows PC hasn't had any new programs installed for half a year or so. [1] Well, almost. The Cookies view in Storage apparently defaulted to mail.google.com when opening it on chat.google.com, and without properly paying attention I copied the alphabetical first |
Just for info I test and it's ok for me now with this exactly commanded: and with incognito browser connection is OK and work :) |
because I get logged out more frequently, I wrote a small bash script which consumes the text copied from the browser into a file
|
@a22sc I developed a tiny web extension to generate that It's available for
Sources are can be found on GitHub: https://github.com/binfalse/matrix-gchat-bridge-login-cookie-generator |
Mine just got logged out after a power outage, tried using @binfalse's browser extension here and I'm still getting "Those cookies don't seem to be valid". UPDATE: Got it working, but had to use a fresh Chrome/Chromium profile, using Incognito mode did not help. |
fwiw it didn't work to extract the cookies from firefox for me. i was successful using chromium instead. i guess what's failing when extracting the cookies from firefox is that the |
I hit that today as well. What finally helped was to follow the instruction exactly as written on a Guest profile in Chrome — I've previously used EditThisCookie in incognito mode to extract the cookies. Make sure you extract the cookies from the |
Just wanted to chime in that it took a Guest profile in Chrome for me as well. I used the following Python script (on Windows) to efficiently extract the cookies from a import win32clipboard
import uncurl
import json
win32clipboard.OpenClipboard()
raw_curl = win32clipboard.GetClipboardData()
win32clipboard.CloseClipboard()
raw_curl = raw_curl.replace("\\\r\n", "")
raw_cookies = uncurl.parse_context(raw_curl).cookies
valid_cookies = {"COMPASS", "SSID", "SID", "OSID", "HSID"}
print("login-cookie " + json.dumps({k: v for k, v in raw_cookies.items() if k in valid_cookies})) |
After 1½ years I got a message from the bridge:
Logged out from Google account
Now any attempt to log in is met with:
Those cookies don't seem to be valid
Have Google changed something with their API? GChat works via the website, so this is not an account issue, and I've tried assembling the login cookie from scratch 3 times.
The text was updated successfully, but these errors were encountered: