SethRzeszutek/LinkedIn-Bot

Handling accounts with 2FA

Opened this issue · 6 comments

For security reasons, many accounts use 2FA to authenticate new connections or browsers logging into the account. Due to the short sleep duration in LinkedInBot-Convert.py,

	if PRINT_ACTIONS:
		print('-> Signing in...')
	time.sleep(3)

users do not have a sufficient amount of time to enter the code. I worked around this by raising the sleep duration to 30-60 seconds, but it would be a better idea to check for the instance of 2FA and pause execution accordingly.

Do you know if it still requires 2FA if you’ve already entered it and chose to remember this browser?

Do you know if it still requires 2FA if you’ve already entered it and chose to remember this browser?

From all of the times that I ran it, it required a new instance of 2FA. I could be wrong though.

It couldn’t hurt to add a setting in there if you have 2FA enabled then it waits else it just continues on.

What did it do after that prompt came up? Did it just take you to the login page?

It couldn’t hurt to add a setting in there if you have 2FA enabled then it waits else it just continues on.

What did it do after that prompt came up? Did it just take you to the login page?

The setting would be best but running headless would be limited.

After I put the code in, I went to my home page and the script resumed executing as intended. Otherwise, it attempted to go to linkedin.com/my-network, but had no session authentication and brought me back to the login page.

I guess a temporary fix would be if 2FA is used, then headless would be disabled. That is a bit discouraging. Maybe there is a way to permanently trust that instance of the browser?

I'm not sure. With each execution of the bot, a new instance of the emulated browser is created which changes the signature/identity of the browser and makes it unrecognized. It might be helpful to look at instead of creating new instances, possibly utilizing existing instances or windows of the browser so it is recognized.