Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added authentication using browser cookie to bypass CHALLENGE #471

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ArujAnand
Copy link

JSESSIONID, li_at cookies can be taken from the browser and be added for authentication to bypass CHALLENGE

@pjpscriv
Copy link

pjpscriv commented Jan 9, 2025

+1 for this PR.

I was getting CHALLENGE failures, installed this version with pip install git+https://github.com/ArujAnand/linkedin-api@feature/authentication-using-cookie, copied over the JSESSIONID + li_at cookies as instructed, and the CHALLENGE error disappeared ✅

I also only needed to copy the cookies for the first time. All succeeding requests (so far) haven't required entering the cookies again.

self._do_authentication_request(username, password)
except ChallengeException:
self.logger.warning("ChallengeException encountered during authentication.")
jsessionid = input("Enter your JSESSIONID cookie from the browser: ")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArujAnand love this idea! My only concern is that this might break some functionality for folks who are running the library on a server somewhere (without a human sitting at the keyboard).

What do you think about adding a parameter to __init__ - something like challenge_prompt_enabled (default to false) - that allows users to turn this behavior on and off?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants