Blog

Late night last night , missed lunch today . Energy levels are low... (15 hours ago)

Unable to find the authorization token Linkedin

While playing around with the LinkedIn API. I encountered an error while trying to authenticate a user via oAuth. I kept getting the error message “unable to find the authorization token”. After digging around Google, I found a helpful tip which helped me solve the problem and thought to share in case anyone else was having the same problem.

Turns out that my server clock was out of sync with the LinkedIn API server time therefore the LinkedIn API server was rejecting the request. The server trying to authenticate a user has to be within 5 minutes of the LinkedIn API server or else the request will be rejected. My server was about 30 minutes behind for some reason and as soon as I corrected it everything worked as it should.

The best way to keep your server time correct is to sync it with a NTP server.

Original source
LinkedIn Developer Network

2 Comments


  1. jack manlosa
    Sep 08, 2011

    i actually encountered this and it’s not about ntp servers.

    it took me sometime to debugged it.

    it has something to do with the servers verifying SSL certificate both HOST and PEER.

    so what you will have to do if your using CURL include these code in you options:

    curl_setopt (CURLOPT_SSL_VERIFYHOST,0);
    curl_setopt (CURLOPT_SSL_VERIFYPEER,0);

    hope that resolves it.

    -jack


    • henry
      Sep 08, 2011

      Thanks Jack,

      This could indeed be one of the causes however in my case I didn’t have an SSL certificate installed or attempting to make a secure connection.

      Updating my server clock fixed the issue and as mentioned in the post, if your server is not within 5 minutes of the LinkedIn API server time it will reject the request.

      Correcting my server time and syncing it with an NTP server (to keep it up to date) solved the problem for me.

      Henry

Leave a Reply