Skip to content
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

Impossible login to GOG.com: invalid cookie ? #2645

Closed
ghost opened this issue Mar 9, 2020 · 11 comments · Fixed by #2653
Closed

Impossible login to GOG.com: invalid cookie ? #2645

ghost opened this issue Mar 9, 2020 · 11 comments · Fixed by #2653

Comments

@ghost
Copy link

ghost commented Mar 9, 2020

Describe the bug

I can't connect Lutris with my GOG.com account: the GOG.com credentials window is here, I can fill it, but when I confirm this form, the window closes and… nothing more. My account isn't connected, and if I close the "Import games" window, I can't reopen it unless I delete '.cache/lutris' directory.

Expected behavior

I should have a second GOG.com form asking for a PIN code, then my account should be connected in Lutris.

Current behavior

As in description above. Plus technical details:

  • two files are created in '~/.cache/lutris/': .gog.auth and .gog.token (attached as gog.auth.txt and gog.token.txt)
  • according to standard output in terminal, some problems with Python, ending with an invalid cookie? (see lutris.txt)

Steps to reproduce

It happens while importing GOG games from the app or installing GOG games from the website.

System information

Fresh Lutris install, Arch Linux, kernel 5.5.8. More in lutris.log

@ZeikoFr
Copy link

ZeikoFr commented Mar 10, 2020

Maybe a stupid question, but did you tried whit another account that does not have pin authentification ?

I don't have a GoG account so I can't test right now to check if you're not alone with this issue

@Hiers
Copy link

Hiers commented Mar 10, 2020

When I logged out of gog in lutris yesterday I wasn't able to log back in and haven't been able since. The situations Manulnzesky has described are the same for me, and the terminal also gives the same errors.

@ZeikoFr
Copy link

ZeikoFr commented Mar 10, 2020

Well Strycore made this commit 9 hours ago on the website (lutris/website@8597df0...b872c67) but I don't think it as to do with your problem I't might be a change on the GoG auth side.

Maybe a more experienced dev will have a better idea of what the root of the problem could be

@ghost
Copy link
Author

ghost commented Mar 10, 2020

I have no other account, but I tried after disabling double authentication from GOG.com. Exactly the same problem.
Nota: you don't have to delete the whole '.cache/lutris' directory to re-enable the "Import games" window, only '.cache/lutris/.gog.auth' is enough. But GOG authentication still fails.

@ericschdt
Copy link

Works for me on Manjaro: After entering the credentials, the 2FA form shows up and I can login successfully.

@lewiji
Copy link

lewiji commented Mar 12, 2020

Same issue here on Ubuntu 20.04.

Can login to GOG through the 'Import Games' dialog, but the games don't load up. If I close the 'Import Games' dialog, I can no longer open it back up unless I delete the .gog.auth file. There's an error in the output:

OSError: invalid Netscape format cookies file '/home/lewis/.cache/lutris/.gog.auth': 'login.gog.com\tFALSE\t/\tTRUE\[token]\tgalaxy-login-s\[token]\tNone'

The source of the error seems to be:

DEBUG    2020-03-12 15:33:19,670 [gog.load_cookies:111]:Loading cookies from /home/lewis/.cache/lutris/.gog.auth
/usr/lib/python3/dist-packages/lutris/util/cookies.py:79: UserWarning: http.cookiejar bug!
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/lutris/util/cookies.py", line 31, in _really_load
    domain, domain_specified, path, secure, expires, name, value = line.split(
ValueError: too many values to unpack (expected 7)

So it looks like the cookie format has changed on the GOG side, possibly?

The auth file contains:

#HttpOnly_login.gog.com FALSE / TRUE [token] galaxy-login-s [token] None

Which is 8 values long, and lutris is expecting 7. Is the comment at the start getting added for some reason?

@lorencinibrdev
Copy link
Contributor

Hi all.

I was checking this, trying to find a workaround the issue, and i've found one:

In the file mentioned above (~/.cache/lutris/.gog.auth), remove the last part of the connection strings demonstrated there. In my case, I've removed a "None" token, as well as the TAB char before it.

Saved the file, and tried to open the Import Games dialog again, and it worked fine.

Seems like python is expecting to split the string using '\t' char, and expects 7 strings as a result, but maybe something changed on GOG side, and a new parameter is passed (The "None").

I"m not sure how secure this WA is, but seems to be working fine here.

@lorencinibrdev
Copy link
Contributor

lorencinibrdev commented Mar 13, 2020

Issue seems to be on the following line, in the 'cookies.py' file. But I'm not sure how to actually fork and suggest a fix. Kinda new to GitHub.

domain, domain_specified, path, secure, expires, name, value = line.split(

I believe we should simply add a new variable after "value", to hold the new token.

@lorencinibrdev
Copy link
Contributor

I've created a pull request with the proposed change. Again, as I'm new in this, please review the changes and see if it fits the project.

#2653

Let me know in case of issues.

@ghost
Copy link
Author

ghost commented Mar 13, 2020

I confirm @lorencinibrdev 's change works. I can now login to my GOG account with Lutris. Well done!

@lorencinibrdev
Copy link
Contributor

I confirm @lorencinibrdev 's change works. I can now login to my GOG account with Lutris. Well done!

Great to know! Let's see if that gets merged up.

@lutris lutris locked as resolved and limited conversation to collaborators Feb 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants