eM Client is stuck in an authentication loop, it appears to send me to an invalid credential page (localhost:)

I have eM Client installed on a machine that has suddenly developed a problem. I have 2 accounts which I use: 1 for only Calendar tracking and the other for email/calendar/contacts. Everything has worked effectively fine until 2 days ago. 

Now, every time I try to connect, eM is giving me a dialog box saying: "Password required for . This operation may take a while to complete. Please be patient"

It then opens a browser page to gmail where it wants me to log in. I enter my password, then it goes to a second page informing me of the permissions it is requested. I click allow.

Here is where things go wrong. After I click allow, it attempts to send me to a page which starts with http://localhost:52160/?code= (snip). My browser responds with an error that the site cannot be reached. It tells me to search Google for localhost 52160.

I did, and there are all sorts of topics which don’t seem to apply…

As far as I know, nothing changed at all on my end. I didn’t change any settings in eM, and eM is hung in a loop at this point. If I click cancel in the popup in eM, it waits a few seconds and repeats the opening of a google login page. Then it’s hung with the same dialog box again.

I tried deleting one of my two accounts (the one with email) and only have the account for a calendar, but I still have the same problem.

I don’t know what else to try… At the moment, I’m resorting to Thunderbird for my email. I definitely want to get this fixed.

Any ideas / suggestions? Is it possible that something changed on Google’s end to cause this? I saw a similar issue reported at this link: https://forum.emclient.com/emclient/topics/gmail-setup

But there were not any replies to it either…

Help?!

Hello Bryan,

After you log into Gmail Webmail, go to account security and please check if the Two-step verification is OFF. You can also try allowing less secure apps to connect to your Gmail account and configure your account again to see if it helps.

Regards,
Russel

Hi Russell,

Thank you for the suggestions. I confirmed that 2-step authentication is turned off for the single account which I am trying to work with now (the calendar only account). I can also see that the account already has permissions set for eM Client. Finally, the “Allow less secure apps” option is set to ON. 

Given those settings (which I didn’t change), it’s doing the exact same thing… :( 

Ok, I have figured out the problem… This is my fault, but I’ll share it here in case anyone ever runs into this again. 

I didn’t think it would matter, but I should have mentioned that I am running eM Client in a VM using Parallels on my Mac. 

Here is what happened. I did change a setting in my Parallels setup. Currently, when I click a link within eM Client, it will launch a web browser in my Windows VM instead of in my native Mac browsers. I would much prefer to launch the browser on my Mac since that is where I do most of my work. 

I just discovered the option to do this the other day. I switched it, and apparently that is what broke me. The localhost address that was sent to the browser was now trying to access something within the Mac space instead of the VM space. 

I changed that option back this morning, and sure enough the authentication ran through my Windows browser and worked. So it seems that eM Client is doing a constant authentication behind the scenes, and it requires that to be done within the Windows VM and cannot go out to the Mac browsers. 

That’s unfortunate… As I said, I would prefer to use the Mac browser when I click links instead of being stuck in the Windows browser space. But it’s more important that my email work, so I will live with that unless you have any suggestions for a way around this… 

Thank you for the suggestions though! Sorry I didn’t mention the VM originally…

Bryan

Hello Bryan,

I am glad that you managed to solve it and thanks for posting the solution as it might help other users in the future.

Regards,
Russel