I am new to Python and I would like to test the Linkedin API. I got an example of authentification code (using oauth2) from this site: https://github.com/ozgur/python-linkedin
I guess there is nothing wrong with the configuration my application on Linkedin:
ID Client : XXX
Secret client : YYY
All these box are checked: r_basicprofile, r_emailaddress, rw_company_admin, w_share
OAuth 2.0 => Authorized URL : http://localhost:8000
Here is the code:
#-*- coding: utf-8 -*-
from linkedin import linkedin
API_KEY = 'XXX'
API_SECRET = 'YYY'
RETURN_URL = 'http://localhost:8000'
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL)
print "authentication.authorization_url : " + authentication.authorization_url
print "authentication.key : " + authentication.key
print "authentication.secret : " + authentication.secret
print "authentication.redirect_uri : " + authentication.redirect_uri
print "authentication.state : " + authentication.state
print authentication.authorization_code
print authentication.token
print authentication._error
application = linkedin.LinkedInApplication(authentication)
And the result is :
authentication.authorization_url : https://www.linkedin.com/uas/oauth2/authorization?scope=&state=a2eb48d9b7b5f94a24dfbf36d498ebdc&redirect_uri=http%3A//localho st%3A8000&response_type=code&client_id=XXX
authentication.key : XXX
authentication.secret : YYY
authentication.redirect_uri : http://localhost:8000
authentication.state : a2eb48d9b7b5f94a24dfbf36d498ebdc
None
None
None
I don't understant why my authorization_code is None. According to the git hub link, redirect_url should contain the URL + the authorization code. Here I just have the URL, so I can't continue the process of authentification.
I made some research but I could'nt find anything. Does someone know what's wrong with my code or my configuration ?
Thanks!