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

LinkedIn OAuth2 bad request. #58

Closed
guyf opened this issue Oct 14, 2013 · 4 comments
Closed

LinkedIn OAuth2 bad request. #58

guyf opened this issue Oct 14, 2013 · 4 comments

Comments

@guyf
Copy link

guyf commented Oct 14, 2013

I have a working django LinkedIn OAuth1 setup. I have tried to switch to OAuth2 by updating all my settings from SOCIAL_AUTH_LINKEDIN_* to SOCIAL_AUTH_LINKEDIN_OAUTH2_* and switching the backend to social.backends.linkedin.LinkedinOAuth2

I get an AuthCancelled Exception. Triggered I think by by HTTPError('400 Client Error: Bad Request',)

The inbound URL looks like:

http://bbm-dev.local:8000/complete/linkedin-oauth2/?redirect_state=c230xy4n04oSAG9x3xwcbEUgudTewZA1&code=AQShEKzGzz2n8lcfl7n9IxLwzWKs2R2g3kwFl5skR04z6Bk_LxYFQF3nrKSalI7Jk3mRGbFZAs60Csd2SW9yNwKZmPY39Iz7fx-E7T_2d2JIRvI7A-c&state=c230xy4n04oSAG9x3xwcbEUgudTewZA1

Have I missed anything in my setup changes? Any other ideas? Thanks.

@omab
Copy link
Owner

omab commented Nov 9, 2013

Actually switching the settings and the backend name should be enough, unless LinkedIn decided to break that migration option. Any luck on your end?

@dblado
Copy link
Contributor

dblado commented Nov 19, 2013

funny enough the twitter dev discussion board had the answer for me...the callback URL in your linkedin app needs to be set -- even though it explicitly says oath1:

this is what I did:

image

https://dev.twitter.com/discussions/1403

@omab
Copy link
Owner

omab commented Nov 19, 2013

@dblado, thanks for the clarification, I've added a reference in the docs regarding that.

@omab omab closed this as completed Nov 19, 2013
@d3prof3t
Copy link

d3prof3t commented Sep 9, 2015

@omab What exactly do we need to specify in the redirect uri in the django app as well as the linkedin app?
My current django app config is:
SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY = 'xxxxxxxxxx'
SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET = 'xxxxxxx'

Add email to requested authorizations.

SOCIAL_AUTH_LINKEDIN_OAUTH2_SCOPE = [
'r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share']

SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/home/'
SOCIAL_AUTH_LOGIN_URL = '/'

Am I missing something in my config file, and exactly what should be the redirect uri in cas of OAuth2?

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

4 participants