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

Unable to Authenticate (2FA with google prompt) with Gmail #1356

Closed
jonathansampson opened this issue Sep 30, 2018 · 21 comments · Fixed by brave/brave-core#1543
Closed

Unable to Authenticate (2FA with google prompt) with Gmail #1356

jonathansampson opened this issue Sep 30, 2018 · 21 comments · Fixed by brave/brave-core#1543

Comments

@jonathansampson
Copy link
Contributor

jonathansampson commented Sep 30, 2018

Test Case

#1356 (comment) as per @fmarier.

Original Issue

Description

With shields up, users are not able to authenticate (2FA) on GMail

Steps to Reproduce

  1. Enable 2FA on Gmail
  2. Attempt to login with Brave

Actual result:

Token is not accepted. Instead, the following message is displayed:

"Your sign-in attempted timed out…"

Expected result:

User should be able to log into GMail

Reproduces how often:

Always

Brave version (chrome://version info)

0.55.10

Reproducible on current release:

Tested on Brave (Core) Beta (0.55.10)

Website problems only:

  • Does the issue resolve itself when disabling Brave Shields? Yes.
  • Is the issue reproducible on the latest version of Chrome? No.

Additional Information

Reported on Twitter:

@peroksid5
Copy link

Have the same problem ... can use 2FA by copying the code from the Authenticator app, but not when I try to approve the login on my phone via 2FA prompt.

@bsclifton bsclifton added webcompat/not-shields-related Sites are breaking because of something other than Shields. workaround/shields-down labels Oct 1, 2018
@bsclifton bsclifton added this to the 1.x Backlog milestone Oct 1, 2018
@bas-jansen
Copy link

Hi, for what its worth I did the following observation.

We know that if you allow all cookies for accounts.google.com via the Brave Shield it works.
I deleted all my cookies and only opened the gmail login. When the 2FA popup shows I have the following cookies:
image
I set the shield back again to default Block 3rd party cookies, deleted all my cookies and allowed cookies on all sites listed above:
image
When opening gmail again and entering credentials the same thing happens as described in this issue. The only cookies I have now are these:
image
So something is still blocking cookies, although I allowed them for all listed sites in the settings.

@rebron rebron added the priority/P2 A bad problem. We might uplift this to the next planned release. label Oct 5, 2018
@saskakol
Copy link

saskakol commented Oct 25, 2018

@bas-jansen Looks like the only cookies that got through have the domain google.com. If you allowed the other ones, (youtube.com and googleusercontent.com) wouldn't that just mean that you allowed the cookies for when you are browsing on those domains? Which means that when you are logging in on a website with the domain google.com, it's still blocking 3rd party cookies, which I would say is the intended behaviour. Maybe there should be a toggle to allow some specific 3rd party cookies on some specific sites?

@lukemulks
Copy link

+1 experiencing the 2fa issue, specifically with the "select to click yes and confirm from another device" option.
brave-2fa-yes-11032018-error
Brave on win10 x64, with 2FA message pushed to Android.

@tildelowengrimm tildelowengrimm added webcompat/shields Shields is breaking a website. bug and removed webcompat/not-shields-related Sites are breaking because of something other than Shields. labels Nov 5, 2018
@matthewsalan
Copy link

Workaround for me was completely disabling Shields on log in. When my gmail loaded, Shields were enabled again automatically.

@jacobc-eth
Copy link

Still experiencing this issue on Version 0.56.15 Chromium: 70.0.3538.110 (Official Build) unknown (64-bit)

@garrettr
Copy link
Contributor

@tomlowenthal For what it's worth, I just encountered this issue and was able to workaround by disabling shields on accounts.google.com. Perhaps we should restore the workaround/shields-down label?

@Brave-Matt
Copy link

@diracdeltas
Copy link
Member

@jonathansampson are you able to still repro this on latest release? if so, what 2fa method are you using?

@diracdeltas diracdeltas changed the title Unable to Authenticate (2FA) with Gmail Unable to Authenticate (2FA with google prompt) with Gmail Jan 29, 2019
@SeanTAllen
Copy link

@diracdeltas I have the latest release 0.58.21 and still experience this issue.

@fmarier
Copy link
Member

fmarier commented Jan 31, 2019

I added Google Prompt as a 2FA option in my account and tried to use it by browsing to https://accounts.google.com.

I got the following error in the developer console:

POST https://content.googleapis.com/cryptauth/v1/authzen/awaittx?alt=json&key=AIzaSy... 403

In the successful case, this request hangs as "pending" until I tap "Yes" on my phone. In the failing case, it immediately returns a 403.

If I enable all cookies on accounts.google.com via Shields, it works just fine so this seems related to our third-party cookie blocking.

I compared the cookies in network traces of a successful v. failing flow and saw the same ones being set. Furthermore, the failing POST request never includes any HTTP cookies so it's unclear to me how blocking third-party cookies affects this.

@diracdeltas
Copy link
Member

diracdeltas commented Jan 31, 2019

@fmarier perhaps it is a referer issue. 3rd party cookie blocking also blocks 3rd party referer (spoofs it to be the origin of the site that it is going to).

so for instance if user is on gmail.com and makes an XHR to googleapis.com, the referer would be spoofed from gmail.com to https://googleapis.com/

@diracdeltas
Copy link
Member

^ to test if this is the fix, you can try adding the relevant domains to IsWhitelistedReferrer in common/shield_exceptions.cc

@fmarier
Copy link
Member

fmarier commented Feb 1, 2019

Fixed in brave/brave-core#1543.

I will prepare PRs for the other branches.

@fmarier fmarier modified the milestones: 1.x Backlog, 0.62.x - Nightly Feb 1, 2019
fmarier added a commit to fmarier/brave-core that referenced this issue Feb 1, 2019
…ve-browser#1356)

Logging into Google Accounts with the Google Prompt 2FA mechanism
doesn't work unless we send the correct referrer as part of the
long-polling XHR to content.googleapis.com.
@fmarier fmarier closed this as completed Feb 5, 2019
@fmarier fmarier modified the milestones: 0.62.x - Nightly, 0.61.x - Dev Feb 5, 2019
fmarier added a commit to fmarier/brave-core that referenced this issue Feb 6, 2019
…ve-browser#1356)

Logging into Google Accounts with the Google Prompt 2FA mechanism
doesn't work unless we send the correct referrer as part of the
long-polling XHR to content.googleapis.com.
@fmarier fmarier modified the milestones: 0.61.x - Dev, 0.60.x - Beta Feb 6, 2019
@srirambv
Copy link
Contributor

@fmarier any QA verification need for this? Could you please add appropriate test plan in the PR?

@fmarier
Copy link
Member

fmarier commented Feb 12, 2019

@srirambv If you want to, that'd be good. I did test it on all of the branches as I was preparing PRs but I haven't re-tested since.

Steps:

  1. Log into https://accounts.google.com with the same account you use on your Android device.
  2. Enable 2FA and use the "Google Prompt" with your Android device.
  3. Open a guest window.
  4. Log into https://accounts.google.com and tap on the prompt on your Android device once it shows up.

@btlechowski
Copy link

btlechowski commented Feb 20, 2019

Verification passed on

Brave 0.60.44 Chromium: 72.0.3626.109 (Official Build) (64-bit)
Revision fae8db7ab9280fa6704a59980263c804f809ebd5-refs/branch-heads/3626@{#857}
OS Windows 7

Used test plan from #1356 (comment)

Verification PASSED on macOS 10.14.2 x64 using the following build:

Brave 0.60.44 Chromium: 72.0.3626.109 (Official Build) (64-bit)
Revision fae8db7ab9280fa6704a59980263c804f809ebd5-refs/branch-heads/3626@{#857}
OS Mac OS X

Verification PASSED on Mint 19.1 x64 using the following build:

Brave 0.60.44 Chromium: 72.0.3626.109 (Official Build) (64-bit)
Revision fae8db7ab9280fa6704a59980263c804f809ebd5-refs/branch-heads/3626@{#857}
OS Linux

@atmin
Copy link

atmin commented Feb 21, 2019

I cannot enable 2FA on Github

Brave Version 0.59.35 Chromium: 72.0.3626.81 (Official Build) (64-bit)
macOS Mojave Version 10.14.3 (18D109)

Shields down, use FreeOTP on Android (which works with other browsers) to scan QR and generate code:
image

@btlechowski
Copy link

@atmin It should be fixed in the next release.

@fmarier
Copy link
Member

fmarier commented Feb 21, 2019

@atmin This bug is about 2FA on Google. It looks like you are running into a different problem (it's on GitHub). Would you mind filing a separate issue for this so that we can track it properly?

@atmin
Copy link

atmin commented Feb 21, 2019

Sorry, disregard, false alarm.

I started investigating the issue to file a bug. The reason turned out to be I accidently turned off date/time sync on my phone, so the clock drifted enough to cause invalid auth codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment