Skip to content

Commit

Permalink
Revert "added authentication via cookies (#63)" (#64)
Browse files Browse the repository at this point in the history
This reverts commit 2f4cc27.
  • Loading branch information
initstring authored Sep 2, 2023
1 parent 2f4cc27 commit 3477cd7
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions linkedin2username.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ def parse_arguments():
help='Specify your password in clear-text on the '
'command line. If not specified, will prompt and '
'obfuscate as you type.')
parser.add_argument('--cookie', type=str, action='store',
help='Instead of logging in with a password, '
'provide the li_at cookie assigned after login ')
parser.add_argument('-n', '--domain', type=str, action='store',
default='',
help='Append a domain name to username output. '
Expand Down Expand Up @@ -256,8 +253,7 @@ def parse_arguments():

# If password is not passed in the command line, prompt for it
# in a more secure fashion (not shown on screen)
if args.cookie is None:
args.password = args.password or getpass.getpass()
args.password = args.password or getpass.getpass()

return args

Expand Down Expand Up @@ -317,14 +313,6 @@ def login(args):
'loginCsrfParam': login_csrf
}

# If authentication via cookies is specified, set the important cookie
# and return the session
if args.cookie:

session.cookies['li_at'] = args.cookie
return session


# Perform the actual login. We disable redirects as we will use that 302
# as an indicator of a successful logon.
response = session.post('https://www.linkedin.com/checkpoint/lg/login-submit'
Expand Down

0 comments on commit 3477cd7

Please sign in to comment.