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

Changes to LinkedIn tutorial #332

Closed
bootrino opened this issue Oct 10, 2018 · 2 comments
Closed

Changes to LinkedIn tutorial #332

bootrino opened this issue Oct 10, 2018 · 2 comments

Comments

@bootrino
Copy link

Looks like LinkedIn is making some changes that probably need to result in changes to the LinkedIn tutorial:

https://developer.linkedin.com/blog/posts/2018/redirecting-oauth-uas

@jtroussard
Copy link
Contributor

jtroussard commented Aug 2, 2019

Along with the updated links, it would seem that LinkedIn is expecting the client_id in the body of the request when trading the verifier code for a a token. I'm not exactly sure where or when it gets left behind but the fetch() method has an argument which forces the client_id to be included in the request body (include_client_id) adding it to the fetch method and setting it to True should make the example work.

linkedin.fetch_token(token_url, client_secret=client_secret,
                     authorization_response=redirect_response,
                     include_client_id=True)

EDIT

Additionally changed the requested resource to

https://api.linkedin.com/v2/me

This returns the following error when run

"Unpermitted fields present in PARAMETER: Data Processing Exception while processing fields [/access_token]"

Seems a parameter, "access_token" is appended to the url, a duplicate of the oauth2_access_token parameter. Removing the duplicate parameter, 'access_token', manually seems to do the trick. I looked around in the code and couldn't determine exactly where the url is built with two parameters. Perhaps someone with a deeper knowledge of the code base can point me in the right direction?

Thanks

EDIT

After playing around some more I found where the duplication occurs. Lots of the work in the module is above me so I just created a dirty work around but perhaps this is a bug someone could look into?

Duplication happens inside the oauth2_session.py module

oauth2_session.py module
|
calls ---> request()
|
calls ---> add_token()

before calling add_token(), according to my debugger the oauth2_access_token parameter is already included in the url. This method returns the url with the additional access_token parameter added... as you would expect from a method named add_token

Am I not understanding the process here? Or could there be a check for the token prior to executing this method?

@jtroussard
Copy link
Contributor

This has been solved with PR #397

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

2 participants