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

Authentication Failure - 400 Bad Request #26

Closed
niabot opened this issue Oct 30, 2019 · 12 comments
Closed

Authentication Failure - 400 Bad Request #26

niabot opened this issue Oct 30, 2019 · 12 comments

Comments

@niabot
Copy link

@niabot niabot commented Oct 30, 2019

If i try to login with my Google account it fails with status code 400 (Bad Request).

  • Thunderbird 68.2.0
  • GData Provider 68.0
  • Windows 7 x64

XHR POST https://accounts.google.com/o/oauth2/token

Request Headers:

Host: accounts.google.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 Lightning/68.2.0
Accept: */*
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Content-Length: 286
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
TE: Trailers

Response Headers:

content-type: application/json; charset=utf-8
vary: Origin
vary: X-Origin
vary: Referer
content-encoding: gzip
date: Wed, 30 Oct 2019 15:30:17 GMT
server: ESF
cache-control: private
content-length: 88
x-xss-protection: 0
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff
alt-svc: quic=":443"; ma=2592000; v="46,43",h3-Q049=":443"; ma=2592000,h3-Q048=":443" ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
X-Firefox-Spdy: h2
@olegch

This comment has been minimized.

Copy link

@olegch olegch commented Oct 30, 2019

I see the same behavior, which started probably yesterday.
It coincided with thunderbird update to 68.2.0, but I am not sure if the issue is due to the new version of Thunderbird and lightning, or Google has changed something in the authentication process.

The same issue is discussed here: https://bugzilla.mozilla.org/show_bug.cgi?id=1592407

@olegch

This comment has been minimized.

Copy link

@olegch olegch commented Oct 30, 2019

It appears that google has just changed their oauth process and started rejecting oauth requests based on the User-Agent header.

Changing "general.useragent.compatMode.firefox" preference to true fixes the issue, google authentication works again.

@leup

This comment has been minimized.

Copy link

@leup leup commented Oct 30, 2019

Indeed it worked !

@Johnny-quattro

This comment has been minimized.

Copy link

@Johnny-quattro Johnny-quattro commented Oct 30, 2019

Oleg, thanks for your very useful nugget of information.
I have two working Gmail accounts that couldn't be added via the new account 'wizard', even when manually added. I changed the about:config on Thunderbird 60.9.0 (64 bit) and it now works perfectly.

@olegch

This comment has been minimized.

Copy link

@olegch olegch commented Oct 30, 2019

Unfortunately it only solved the problem for my personal google account.
My work account on gsuite still does not work.

A message is different though - it is 401 (Unauthorized) with "invalid_client" error in the response.

I tried configuring gsuite account trying to enable lightning OAuth client in the setting, but no luck so far.

@kewisch

This comment has been minimized.

Copy link
Owner

@kewisch kewisch commented Oct 30, 2019

I'm wondering if #23 is related, are you getting the same error message? Thanks for the workaround.

For the invalid_client error, this seems to be different, and normally happens if the client id is wrong. Could you try reinstalling the latest version there?

@olegch

This comment has been minimized.

Copy link

@olegch olegch commented Oct 30, 2019

Philipp, thanks for suggestion.
It seems the problem has somehow fixed itself, because now it works for both my accounts - the personal one, and the gsuite work one.

Just for record keeping here is the summary of what I experienced:

  1. I run the latest Thunderbird (68.2.0), lightning (68.2.0), and provider for google calendar extension (68.0)
  2. I have google calendars from two google accounts (personal, and gsuite) registered in thunderbird/lightning with the google calendar provider extension.
  3. a day or two ago google authentication by google calendar provider started breaking for both accounts with 400 error
  4. today, after I applied the general.useragent.compatMode.firefox fix, personal google calendar authentication started working again, but gsuite account authentication still did not work, although with a different error message - 401 (Unauthorized) invalid_client
  5. I fiddled a little bit with gsuite account admin and security settings, in particular registering Lightning OAuth client ID in the list of trusted web applications, but it did not seem to fix the problem, at least not at the moment.
  6. Now, about an hour or two later, I see that gsuite calendar authentication works again without problems.

The only theory I have about that is that maybe fiddling with gsuite settings is what fixed it, but it just was not immediately propagated through googles infrastructure and took effect after some while.
Alternatively, maybe google had a problem and fixed over these couple of hours.

@ottomano

This comment has been minimized.

Copy link

@ottomano ottomano commented Oct 31, 2019

Yes, it works!

@mpapis

This comment has been minimized.

Copy link

@mpapis mpapis commented Oct 31, 2019

For me it worked after adding a lot of google addresses to allowed cookies and then the flag... maybe it would have worked without the cookies.

@peci1

This comment has been minimized.

Copy link

@peci1 peci1 commented Nov 1, 2019

Are there any known side-effects for setting the property general.useragent.compatMode.firefox ?

@gdsotirov

This comment has been minimized.

Copy link

@gdsotirov gdsotirov commented Nov 3, 2019

Arghhh, "thank you" Google. Such problems really drive me nuts and hopefully I found the workaround, because I'm used using Calendar in Thunderbird.

@kewisch

This comment has been minimized.

Copy link
Owner

@kewisch kewisch commented Nov 4, 2019

If the compatMode pref is working, then this is a duplicate of #23 indeed. Thanks for confirming!

@kewisch kewisch closed this Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.