LinkedIn-Bot icon indicating copy to clipboard operation
LinkedIn-Bot copied to clipboard

Handling accounts with 2FA

Open romansorin opened this issue 5 years ago • 7 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.

romansorin avatar May 14 '19 22:05 romansorin

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

SethRzeszutek avatar May 14 '19 22:05 SethRzeszutek

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.

romansorin avatar May 14 '19 22:05 romansorin

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?

SethRzeszutek avatar May 14 '19 22:05 SethRzeszutek

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.

romansorin avatar May 14 '19 22:05 romansorin

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?

SethRzeszutek avatar May 14 '19 23:05 SethRzeszutek

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.

romansorin avatar May 15 '19 00:05 romansorin

The best way is to implement a cache here

saadfareed avatar Aug 23 '24 23:08 saadfareed