python-linkedin icon indicating copy to clipboard operation
python-linkedin copied to clipboard

Cannot Authenticate

Open NumberChiffre opened this issue 8 years ago • 3 comments

Hello Everyone,

I'm trying to authenticate via c9 and the error I get is the following:

https://www.linkedin.com/uas/oauth2/authorization?scope=r_basicprofile%20rw_nus%20r_network%20r_contactinfo%20w_messages%20rw_groups%20r_emailaddress%20r_fullprofile&state=81da2582bbb27e03fec1d10c559c9cfa&redirect_uri=https%3A//linkedinpy-terenceliu.c9users.io%3A8080/&response_type=code&client_id=77gzzds2hizpxq None Traceback (most recent call last): File "main.py", line 52, in <module> print oauth.get_access_token() File "/usr/local/lib/python2.7/dist-packages/linkedin/linkedin.py", line 108, in get_access_token assert self.authorization_code, 'You must first get the authorization code' AssertionError: You must first get the authorization code

I think the authentication url that I receive is wrong. In the Developer's App on linkedin, I added "https://linkedinpy-terenceliu.c9users.io:8080/" Not sure what is the correct format to add or could this be the issue.

Would be grateful if anyone can lend me a hand!

Thanks!

NumberChiffre avatar Dec 26 '16 07:12 NumberChiffre

Since you're not using localhost, maybe leave the port number off? e.g. https://linkedinpy-terenceliu.c9users.io

With that said, I think the library might be dead. Additionally, given the error message, are you sure that you set the following variables?

# Define CONSUMER_KEY, CONSUMER_SECRET,  
# USER_TOKEN, and USER_SECRET from the credentials 
# provided in your LinkedIn application

hydrosquall avatar Dec 26 '16 17:12 hydrosquall

@hydrosquall Thanks for replying! I tried without the port number and it doesnt work either, same result and error as shown above. I only can see clientID and clientSecret, and I am suppose to generate the access token from running the authentication. Direct access is blocked as well, so I guess python is not the way to go?

NumberChiffre avatar Dec 26 '16 22:12 NumberChiffre

So the python library does work, but for 4 basic functions. You can see that I provided in #103 the list of methods that are supported / not supported given the most recent (May 2016) revisions to the LinkedIn API. Is the API call you're hoping to use still supported?

I wonder if the issue might be related to trying to deploy the application in the cloud9 environment. I've been able to get this to work (for the 4 basic functions) when running the application locally (on my own computer).

hydrosquall avatar Dec 28 '16 01:12 hydrosquall