Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Can't login to Gmail with OAuth2

A friend recommended Thunderbird to me, I'm an Ubuntu user with Thunderbird version 128.6.0esr I'm trying to connect to my Gmail account and I'm having a tough time IMAP is enabled despite what Google says, IMAP wasn't on by default so I turned it on. There's no "Sign in with Google" in Thunderbird so I just enter the account email and password manually, the good news is Mozilla already configured OAuth2, the bad news is that the window pops up, I log in to Google, hit allow but I get "Unable to log in at server Probably wrong configuration, username or password. " So I cleared the cookies and allowed all third-party cookies(added it in exceptions with allow, just to be sure), cleared passwords too, and enabled javascript as told by Mozilla, but I still get the same window(this time just the access request came up without requiring username and password) and the same error, I even got an App Password because I do have 2-Step Verification enabled and tried that just to be sure but still the same thing The funny thing is that I tried Thunderbird on Android and it connected just fine without any additional step

at this point, I'm out of any new ideas and I ask for your help

A friend recommended Thunderbird to me, I'm an Ubuntu user with Thunderbird version 128.6.0esr I'm trying to connect to my Gmail account and I'm having a tough time IMAP is enabled despite what [https://support.google.com/mail/answer/7126229?hl=en&ref_topic=7280141&sjid=9149263008061901560-EU Google] says, IMAP wasn't on by default so I turned it on. There's no "Sign in with Google" in Thunderbird so I just enter the account email and password manually, the good news is Mozilla already configured OAuth2, the bad news is that the window pops up, I log in to Google, hit allow but I get "Unable to log in at server Probably wrong configuration, username or password. " So I cleared the cookies and allowed all third-party cookies(added it in exceptions with allow, just to be sure), cleared passwords too, and enabled javascript as told by [https://support.mozilla.org/en-US/kb/automatic-conversion-google-mail-accounts-oauth20 Mozilla], but I still get the same window(this time just the access request came up without requiring username and password) and the same error, I even got an [https://support.google.com/accounts/answer/185833?hl=en&ref_topic=7189145&sjid=9149263008061901560-EU App Password] because I do have 2-Step Verification enabled and tried that just to be sure but still the same thing The funny thing is that I tried Thunderbird on Android and it connected just fine without any additional step at this point, I'm out of any new ideas and I ask for your help

Chosen solution

I'll run through things to check. If you had already managed to get an Oauth token set up and saved in the account passwords then when you attempt to logon a second time, it would not be expecting a normal password, so could be a problem. I also note you say you have created an 'app password' - so it's possible gmail is not expecting the normal password.

So, make sure account is removed from Thunderbird. Then check Settings > Privacy & Security Under Passwords section click on 'Saved Passwords' and 'Show Passwords' to see if there are any passwords for imap, smtp and oauth set up - remove all of them.

You say IMAP has been enabled in webmail account.

  • In Settings > Privacy & Security - check you have this:
  • Web Content
  • Select 'Accept cookies from sites'
  • Accept third party coolies = Always
  • click on 'Exceptions' and make sure you have: https://accounts.google.com set as 'Allow'

Restart Thunderbird.

Additional checks. Make sure you do not have anything using the 'localhost' eg: Apache Xampp If you do then switch it off until you have set up the oauth token and gmail is working.

Also do you have a VPN switched on? I've come across some people who did not realise one was switched on. If yes, then you need to switch it off as gmail does not like it - it's expecting your computer IP address, so thinks anything else is someone trying to hack the account.

Then try to create an account. Enter name, email address and normal password - but I note you say you have created an 'app specific password' - so this time enter the 'app specific password' instead of the normal one. Select to save password and click on Continue. Thunderbird will auto look for settings and choose IMAP by default.

You should then get the google pop up - to allow Thunderbird.

Read this answer in context 👍 1

All Replies (2)

Chosen Solution

I'll run through things to check. If you had already managed to get an Oauth token set up and saved in the account passwords then when you attempt to logon a second time, it would not be expecting a normal password, so could be a problem. I also note you say you have created an 'app password' - so it's possible gmail is not expecting the normal password.

So, make sure account is removed from Thunderbird. Then check Settings > Privacy & Security Under Passwords section click on 'Saved Passwords' and 'Show Passwords' to see if there are any passwords for imap, smtp and oauth set up - remove all of them.

You say IMAP has been enabled in webmail account.

  • In Settings > Privacy & Security - check you have this:
  • Web Content
  • Select 'Accept cookies from sites'
  • Accept third party coolies = Always
  • click on 'Exceptions' and make sure you have: https://accounts.google.com set as 'Allow'

Restart Thunderbird.

Additional checks. Make sure you do not have anything using the 'localhost' eg: Apache Xampp If you do then switch it off until you have set up the oauth token and gmail is working.

Also do you have a VPN switched on? I've come across some people who did not realise one was switched on. If yes, then you need to switch it off as gmail does not like it - it's expecting your computer IP address, so thinks anything else is someone trying to hack the account.

Then try to create an account. Enter name, email address and normal password - but I note you say you have created an 'app specific password' - so this time enter the 'app specific password' instead of the normal one. Select to save password and click on Continue. Thunderbird will auto look for settings and choose IMAP by default.

You should then get the google pop up - to allow Thunderbird.

Helpful?

Thank you for your super detailed explanations, I tried them one by one and it seems XAMPP was causing issues. I started and stopped all its services, and suddenly the messages started coming in

Thank you very much

Helpful?

Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.