I know, questions regarding this have been asked before but I can´t find a solution. I Am trying to access my LinkedIn account through the supposedly simple to use python-linkedin library but cannot do it. According to Ozgur's page https://github.com/ozgur/python-linkedin I should be able to open the link generated from the .authorization_url function but that doesn´t work as I get an error saying that my redirect link is wrong even though I have entered it in my application at LinkedIn's developer page. I.e. when trying to open the link that the .authorization_url function gives, what shows up in the browser is the following error message:
"invalid redirect_uri. This value must match a URL registered with the API Key."
What I´m expecting is a page where I can approve access to my account. Can I, as in the code below have localhost:8000 (as Ozgur's page shows) as redirect link or what kind of link does it have to be? Can it be whatever?
from linkedin import linkedin
import webbrowser
API_KEY = '********'
API_SECRET = '*******'
RETURN_URL = 'http://localhost:8000'
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
print (authentication.authorization_url) # open this url on your browser
webbrowser.open(authentication.authorization_url)
application = linkedin.LinkedInApplication(authentication)
authentication.authorization_code = '4CqONljAz622ZBo0'
authentication.get_access_token()
Exactly how do I do this?
One more question, the above refers to using Oauth2, but it should still be possible to use Oauth1 according to their developers page, and not yet deprecated. However, for using Oauth1 one needs four different keys, the ones mostly referred to:
CONSUMER_KEY, CONSUMER_SECRET, USER_TOKEN, USER_SECRET
However from the application page (i.e. LinkedIn's, where one registeres the application) I can only find two: ClientID and Client_SECRET, which are for Oauth2. Does that mean it is not possible to use oauth1 anyway?