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

Can't Login to Google Drive #1359

Closed
testgoofy opened this issue Nov 27, 2019 · 28 comments
Closed

Can't Login to Google Drive #1359

testgoofy opened this issue Nov 27, 2019 · 28 comments
Assignees
Labels
› Storage Storage providers: Dropbox, Google, WebDAV, etc... Type ◦ Bug Something isn't working
Milestone

Comments

@testgoofy
Copy link

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 🥇 )

Screenshots
image
image

Environment
KeeWeb v1.12.3 (9b07bbd, 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

@antelle
Copy link
Member

antelle commented Nov 27, 2019

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.

@antelle antelle added Type ◦ Bug Something isn't working › Storage Storage providers: Dropbox, Google, WebDAV, etc... labels Nov 27, 2019
@antelle antelle added this to the Future milestone Nov 27, 2019
@antelle
Copy link
Member

antelle commented Nov 27, 2019

https://support.google.com/accounts/answer/7675428 - can be a solution

@jac1013
Copy link

jac1013 commented Nov 30, 2019

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?

@antelle
Copy link
Member

antelle commented Dec 1, 2019

@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?

@testgoofy
Copy link
Author

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 :)

@jac1013
Copy link

jac1013 commented Dec 2, 2019

@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.

@testgoofy
Copy link
Author

@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

@ab623
Copy link

ab623 commented Dec 14, 2019

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.

@ab623
Copy link

ab623 commented Dec 16, 2019

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.

@antelle
Copy link
Member

antelle commented Dec 16, 2019

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.

@ab623
Copy link

ab623 commented Dec 16, 2019

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.

@antelle
Copy link
Member

antelle commented Dec 16, 2019

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.

@mikeeq
Copy link

mikeeq commented Dec 16, 2019

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:
ramboxapp/community-edition@83e7fd3#diff-a1a394aeee689cb11ac0c963e63d78fdR291

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

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

@ab623
Copy link

ab623 commented Dec 17, 2019

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.

@tim-crisp
Copy link

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.

@Deco
Copy link

Deco commented Dec 22, 2019

@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.

@antelle
Copy link
Member

antelle commented Dec 22, 2019

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.

@gargamon2
Copy link

People using Tusk (whatever that is) have a similar issue that may clarify. Here's the discussion:
klaudiosinani/tusk#243

@bmehling
Copy link

bmehling commented Jan 4, 2020

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

@Wharenn
Copy link

Wharenn commented Jan 5, 2020

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

@jannisbecker
Copy link

buttercup/buttercup-desktop#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.

@bmehling
Copy link

bmehling commented Jan 7, 2020

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

@jtuffin
Copy link

jtuffin commented Jan 11, 2020

+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.

@andremann
Copy link

andremann commented Jan 14, 2020

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

@Xstoudi
Copy link

Xstoudi commented Jan 16, 2020

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

@antelle
Copy link
Member

antelle commented Jan 16, 2020

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.

@keeweb keeweb locked as too heated and limited conversation to collaborators Jan 16, 2020
@antelle antelle modified the milestones: Future, v1.13 Jan 16, 2020
@antelle
Copy link
Member

antelle commented Mar 17, 2020

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

@antelle antelle self-assigned this Mar 17, 2020
@antelle antelle closed this as completed in 7ccf38f Apr 3, 2020
@antelle
Copy link
Member

antelle commented Apr 3, 2020

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
› Storage Storage providers: Dropbox, Google, WebDAV, etc... Type ◦ Bug Something isn't working
Projects
None yet
Development

No branches or pull requests