Keeweb: Can't Login to Google Drive

Created on 27 Nov 2019  Â·  28Comments  Â·  Source: keeweb/keeweb

Describe the bug
If I try to sign in to my Google Account, an error message occupears. The browser seems not to be supported.

To Reproduce
Steps to reproduce the behavior:

  1. Start the app and close all open databes
  2. In the startscreen click to 'More'
  3. Click to 'Google Drive' -> a small windows with the sign - in dialog pops up
  4. Insert your google mail address and click to 'next'
  5. See the error

Expected behavior
I expected to log in and be able to sync with the google drive. Like in the web app (which is really amazing, by the way :1st_place_medal: )

Screenshots
image
image

Environment
KeeWeb v1.12.3 (9b07bbd5, 2019-11-06)
Environment: electron v7.0.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) KeeWeb/1.12.3 Chrome/78.0.3905.1 Electron/7.0.0 Safari/537.36

Logs
[INFO ] 2019-11-27T19:55:37.275Z [app] Started in 531ms ¯_(ツ)_/¯
[INFO ] 2019-11-27T19:55:37.340Z [updater] Next update check will happen in 85334s
[DEBUG] 2019-11-27T19:55:40.623Z [storage-gdrive] OAuth: popup opened
[ERROR] 2019-11-27T19:55:53.179Z [storage-gdrive] OAuth error popup closed
-1574884621402.log

bug storage

All 28 comments

Wow, I actually don't know what to do with it. Google usually says don't mess up with user-agent, so I'd prefer to avoid changing it intentionally.

I'm also affected by this one, some interesting points:
1 - I'm able to login with another Google Account
2 - The account with which I get the error is password and 2FA (through clicking a notification in the phone) protected, could it be related to this?

@testgoofy is the Google Account you are trying to use 2FA protected?

@jac1013 even if it is, it depends on browser (user-agent), now 2FA being used or not (for example, for me it works perfectly with 2FA on macOS and Windows). What is your OS?

I'm also affected by this one, some interesting points:
1 - I'm able to login with another Google Account
2 - The account with which I get the error is password and 2FA (through clicking a notification in the phone) protected, could it be related to this?

@testgoofy is the Google Account you are trying to use 2FA protected?

Yes I'm also using 2FA :)

@antelle good question, I didn't specify that in my steps, I'm using the desktop version, I'm not sure which browser the desktop version is trying to use.

I have installed both Chrome and Firefox. I'm in LinuxMint 19.

@jac1013 even if it is, it depends on browser (user-agent), now 2FA being used or not (for example, for me it works perfectly with 2FA on macOS and Windows). What is your OS?

I'm using Linux Mint

Here are the deatils:

  • kernel-version: 75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019
  • kernel-release: 4.15.0-66-generic

I too am having the exact same issue. I was using Keeweb on Desktop on Ubuntu with an account I signed into months ago, and it was working fine. I then reinstalled Ubunutu, and tried to login to my GDrive account and am getting the same issue.

I have consulted the link it provides, but that did not solve the solution. Keeweb in the browser worked fine, but I assume that was already using my existing logged in account.

Happy to provide any other information as required.

I too have 2FA, but I agree this should not affect the login process. I didnt even get to the point where it initiated the 2FA, once I input my password, I got the above error. It seems to be the way the login processes is handling the Keeweb's request.

Uncovering an article it seems like Google is blocking multiple browsers.
https://www.bleepingcomputer.com/news/google/google-now-bans-some-linux-web-browsers-from-their-services/

If it's a user agent thing, can the current implantation support changing user agent? I am not a JS developer but looking at the code which uses xmlhttprequest, it seems like user agents can't be modified. Although as mentioned it not my area, so I could be entirely incorrect.

We shouldn’t change user-agent for this. Technically it’s possible and very easy, but it’s against Google’s policy, so we may not do it: https://developers.google.com/terms/api-services-user-data-policy

Do not mislead Google about an application's operating environment. You must accurately represent the environment in which the authentication page appears. For example, don't claim to be an Android application in the user agent header if your application is running on iOS, or represent that your application's authentication page is rendered in a desktop browser if instead the authentication page is rendered in an embedded web view.

Understood. Assuming we cannot go ahead with he user agent approach, what are the other options here?

I know solutions such as rclone generate a link to validate in any browser and then capture the authentication response. Maybe that could be an option, albeit a bit cumbersome.

Probably it should open a sign-in page in a browser, like some other apps do. But I haven't checked how it's done and what's required to support it.

I'm having the same issue on latest desktop version of keeweb, fresh install of Win10 and new google account. Never had a problem before, does anyone know any workaround/fix?

EDIT:
Guys from ramboxapp fixed that by defining user-agent:
https://github.com/ramboxapp/community-edition/commit/83e7fd38d6859bd6d74b0348dd4c29a0c5f8b4b2#diff-a1a394aeee689cb11ac0c963e63d78fdR291

https://github.com/ramboxapp/community-edition/issues/2495

There should be a 'better way' of fixing that :D

It's also affecting my windows 10 machine too.

I was already authed with Google, which today failed the sync. Attempting a resolution by selecting my Google account to use, causes the popup to disappear and I get a "did-fail-load" error in the console.

I had the same issue with google login yesterday. Tried it again today and it worked fine for me. This is on a windows 10 machine.

@antelle, could you not just open the web page in the user's default browser? I've seen a number of applications do it this way -- I don't think you need to provide a web client yourself.

We can open a page, however the problem is to handle its result. Probably we need to register a custom url scheme, handle it, etc... In other words, it's not a one-line change, unfortunately.

People using Tusk (whatever that is) have a similar issue that may clarify. Here's the discussion:
https://github.com/klaussinani/tusk/issues/243

I also have this issue. Same steps to reproduce, however I receive the error after entering my password. The error dialog is slightly different (but I assume same root cause):

image

My gSuite account has 2FA enabled.

Two machines affected, both are MacOS Catalina / Chrome (default browser).

I do not think this Keeweb error will surprise anyone, but here's what I see in the sync setup:

image

Same issue, windows 10, desktop app, google account with 2FA activated.

https://github.com/buttercup/buttercup-desktop/issues/850
The guys at buttercup had the same issue
and fixed it recently by moving google auth to the user's web browser.
Can confirm for buttercup that it fixed the issue completely.

This aligns with the suggested solution referenced in the help article when auth fails: https://developers.google.com/identity/protocols/OAuth2InstalledApp

+1 for issues with Google Drive and 2FA.

I initially thought it was as a result of Catalina upgrade, but can also confirm this still occurs on Mojave.

+1! Same issue on the MacOS standalone app; working fine on the webapp.

Same issue, Windows 10 standalone app, 2FA disabled.

Thanks for your comments and reports, looks like it behaves quite often like this, and now it's becoming a rule rather than exception, so we should fix it by opening Google login in a browser and handling the return url (that's the most complicated part here because we need to configure installers).
I'll lock the issue because:

  • it's 100% clear why it happens and how to fix it
  • it happens for a lot of users, we already know it
  • there's not much useful information that can be added here
  • no more reports are required either
  • in the current version of KeeWeb there's no workaround

If you came here to add another comment, please don't. PR's are very welcome, otherwise I'll fix it in the next release of KeeWeb.

Update

  • the issue is fixed, now a browser tab will be opened to authenticate, as the official guide suggests
  • it should work on all supported desktop platforms
  • KeeWeb will listen on a local TCP port during authentication, again, that's the officially suggested way of handling authentication result
  • after authentication refresh_token will be saved in the app, which means, it will last forever, unless you manually revoke it
  • the fix is coming in v1.13 and not earlier than that (a list of remaining issues for this release can be found here, but that's a soft list, if they take too much time, it will be released earlier)
  • a new release is expected to happen in April
  • if you would like to give it a test, you can try the beta version using the beta button in Settings > Advanced, please contact me if it Google Drive login doesn't work for you on beta
  • since the discussion is a bit hot, I'm not going to reopen comments here, basically there's nothing to discuss and there will be no further update before v1.13 release

The new release is rolled out! Please give it a test and submit a new issue if it doesn't work for you. Happy Google Driving!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rurik19 picture Rurik19  Â·  31Comments

jlundan picture jlundan  Â·  39Comments

Aneyrin picture Aneyrin  Â·  28Comments

alexandru picture alexandru  Â·  27Comments

leolivier picture leolivier  Â·  46Comments