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

Can anyone get the authentication to work at all? #111

Open
clivebearmanhub opened this issue Apr 30, 2018 · 8 comments
Open

Can anyone get the authentication to work at all? #111

clivebearmanhub opened this issue Apr 30, 2018 · 8 comments

Comments

@clivebearmanhub
Copy link

Seems like the move to OAuth 2 by LinkedIn has totally broken this library. Even if you follow the instructions and manually copy the authorization code, it fails to retrieve the token and raises an exception.
Is this the same for everyone? Or am I just too stupid to get it to work. Any help is gratefully appreciated.

raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://www.linkedin.com/uas/oauth2/accessToken

@shroffshivangi
Copy link

shroffshivangi commented Jul 31, 2018

Use this:

curl -X POST --http1.1 "https://www.linkedin.com/oauth/v2/accessToken" --cookie "X-Csrf-Token: 987654321" -d "grant_type=authorization_code&code=authorizationcodehere&redirect_uri=http%3A%2F%2Flocalhost%2Fcode&client_id=client_id&client_secret=client_secret" -H "Content-Type: application/x-www-form-urlencoded"

@37Rokibul
Copy link

37Rokibul commented Aug 10, 2018

@shroffshivangi
can you please tell me how I get -cookie "X-Csrf-Token: 987654321"??? I can do all the things except X-CSRF- TOKEN.

@shroffshivangi
Copy link

It's same as the state that you put in the previous step.

@37Rokibul
Copy link

@shroffshivangi

Hello,
I have a problem. I do not know why invalid requests shows. I am confused about redirect url
results are shown below.

invalid_request","error_description":"Unable to retrieve access token: a ppid/redirect uri/code verifier does not match authorization code. Or authorizat ion code expired. Or external member binding exists"

please help me out about this problem.

@37Rokibul
Copy link

@shroffshivangi
Can you please tell what is the redirect url?? I used emblemidea.com for linkedin app. should I use callback encodeed url or any other url??

@shroffshivangi
Copy link

shroffshivangi commented Aug 15, 2018

You can use any redirect url, it should just be a valid one.

If the redirect uri is https://www.google.com - Step 1 would be something like this:

https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=your_client_id&redirect_uri=https%3A%2F%2Fwww.google.com&state=987654321&scope=rw_company_admin%20r_emailaddress%20w_share%20r_basicprofile

Note: the scope is what permissions you want your application to have.

@37Rokibul
Copy link

37Rokibul commented Aug 15, 2018

@shroffshivangi
actually I want to solve step 3.
in step 3, in POST method, when I use git bash for get access token via using your 1st comment code sample, I get invalid as result. how can I solve it??

@37Rokibul
Copy link

Hey @shroffshivangi ,
I am regardly waiting for your response. as I can't solve it. please help me in step 3 as documentation.

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