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

[Fatal] Could not authenticate to linkedin. Set credentials in your environment variables. #31

Open
0xCGonzalo opened this issue Dec 17, 2023 · 3 comments

Comments

@0xCGonzalo
Copy link

0xCGonzalo commented Dec 17, 2023

Hello,

I have configured the credentials in the configuration file and in the environment variables:

cat config.py~:

...
linkedin = dict(
    username = '[email protected]',
    password = '#ExamplePwd123!'
)
...

export LI_USERNAME={[email protected]}
export LI_PASSWORD={#ExamplePwd123!}

and

export [email protected]
export LI_PASSWORD=#ExamplePwd123!

I keep getting the same validation error.

Is the correct endpoint yet?

@pmarrapese
Copy link

I was running into this too, so I enabled HTTP request logging by adding the following to ScrapedIn.py:

import http

http.client.HTTPConnection.debuglevel = 1

When I ran the script, it showed I was being redirected to a /checkpoint/challenge/ URL -- i.e., LinkedIn found the script's login attempt suspicious.

You can get around this by authenticating via your browser, obtaining the li_at cookie value, then changing line 338 to:

cookies = { 'li_at': 'yourHugeSessionTokenThatYouGotFromYourBrowserGoesHere' }

I've need to massage a few other lines to get the actual search/parsing working, but that should at least handle auth for you.

@0xCGonzalo
Copy link
Author

@pmarrapese thank you!

@nijaare
Copy link

nijaare commented Mar 1, 2024

Hi @pmarrapese i dont understand yet at

import http
http.client.HTTPConnection.debuglevel = 1
/checkpoint/challenge/
li_at
cookies = { 'li_at': 'yourHugeSessionTokenThatYouGotFromYourBrowserGoesHere' }

Could you explain it step by step or in a video? Thanks!

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

No branches or pull requests

3 participants