DEKHTIARJonathan / python3-linkedin

Python3 interface to the LinkedIn API
https://dekhtiarjonathan.github.io/python3-linkedin/
MIT License
84 stars 36 forks source link

Authentication problems in httpy_api.py #4

Closed ahnugent closed 7 years ago

ahnugent commented 7 years ago

When I run httpy_api.py I get a long list of exceptions that I think are coming from incorrect authentication. The readme.md file says to set LINKEDIN_API_KEY and LINKEDIN_API_SECRET, but the LinkedIn Developers page does not seem to use these, but rather Client ID and Client Secret. If I insert print functions in httpy_api.py after liw = LinkedInWrapper() I find that liw.API_KEY and liw.API_SECRET are both None.

Here is a sample of the error traceback:

Server started on port:8080 127.0.0.1 - - [19/Sep/2017 10:12:19] "GET / HTTP/1.1" 200 - Traceback (most recent call last): File "C:\Users\allen\Anaconda3\envs\prospecting\lib\socketserver.py", line 625, in process_request_thread self.finish_request(request, client_address) File "C:\Users\allen\Anaconda3\envs\prospecting\lib\socketserver.py", line 354, in finish_request self.RequestHandlerClass(request, client_address, self) File "C:\Users\allen\Anaconda3\envs\prospecting\lib\socketserver.py", line 681, in init self.handle() File "C:\Users\allen\Anaconda3\envs\prospecting\lib\http\server.py", line 422, in handle self.handle_one_request() File "C:\Users\allen\Anaconda3\envs\prospecting\lib\http\server.py", line 410, in handle_one_request method() File "C:/Py_data/LinkedIn/python3-linkedin/examples/http_api.py", line 65, in do_GET open_new_tab(liw.authentication.authorization_url) File "C:\Users\allen\Anaconda3\envs\prospecting\lib\site-packages\linkedin\linkedin.py", line 112, in authorization_url qsl.append('%s=%s' % (quote(k), quote(v))) File "C:\Users\allen\Anaconda3\envs\prospecting\lib\urllib\parse.py", line 712, in quote return quote_from_bytes(string, safe) File "C:\Users\allen\Anaconda3\envs\prospecting\lib\urllib\parse.py", line 737, in quote_from_bytes raise TypeError("quote_from_bytes() expected bytes") TypeError: quote_from_bytes() expected bytes

DEKHTIARJonathan commented 7 years ago

I will try to have a look by tonight (Europe time). Did you have modified the code by any way @ahnugent ? And you're correct about Client/API token ;) It's because, LinkedIn API switched to OAuth2 while keeping the possibility for OAuth1

ahnugent commented 7 years ago

My only mods have been the print() statements following the instantiation of liw as a LinkedInWrapper object. Thanks!

DEKHTIARJonathan commented 7 years ago

@ahnugent : I think the problem comes from your side, are you sure you use an up to date python 3 ?

I will release a new version of the API in the afternoon and update the examples to make them more clear regarding your remarks.

Edit:

DEKHTIARJonathan commented 7 years ago

@ahnugent maybe the the PR #6 goes toward solving your issues. Can you check and close this issue if it's okay

DEKHTIARJonathan commented 7 years ago

Without any answer I close this issue

ahnugent commented 7 years ago

Sorry, mate. My window of opportunity to work on that project closed and I haven't had a chance to return to it.

Thanks for your patience.

Allen Nugent BSc PhD M: 0437 984 666

On Sun, Nov 5, 2017 at 8:59 AM, Jonathan DEKHTIAR notifications@github.com wrote:

Without any answer I close this issue

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DEKHTIARJonathan/python3-linkedin/issues/4#issuecomment-341932778, or mute the thread https://github.com/notifications/unsubscribe-auth/ALv2VujksgVP5HoqBsY-0mJRi-g7bbhaks5szN4mgaJpZM4Pbtvi .