Authenticate To Linkedin
I am trying to write a code that get some user's linkedin profile and just print it this is my code from linkedin import linkedin CONSUMER_KEY = 'XXXXX' CONSUMER_SECRET = 'XXXXX'
Solution 1:
Not tested. Try this
As per the documentation. Access token must be generated to grand access to the application.
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
application = linkedin.LinkedInApplication(token=authentication.get_access_token())
print authentication.authorization_url
When you grant access to the application, you will be redirected to the return url with the following query strings appended to your RETURN_URL:
"http://localhost:8000/?code=AQTXrv3Pe1iWS0EQvLg0NJA8ju_XuiadXACqHennhWih7iRyDSzAm5jaf3R7I8&state=ea34a04b91c72863c82878d2b8f1836c"
Copy the code manually and set like
authentication.authorization_code = 'AQTXrv3Pe1iWS0EQvLg0NJA8ju_XuiadXACqHennhWih7iRyDSzAm5jaf3R7I8'
authentication.get_access_token() #AQTFtPILQkJzXHrHtyQ0rjLe3W0I
application = linkedin.LinkedInApplication(token='AQTFtPILQkJzXHrHtyQ0rjLe3W0I')
Post a Comment for "Authenticate To Linkedin"