PHP Classes

Errors on login_with_linkedin2.php and login_with_linkedin.php

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Errors on login_with_linkedin2.php...  >  (Un) Subscribe thread alerts  
Subject:Errors on login_with_linkedin2.php...
Summary:I used the sample files, with my ID and Secret...
Messages:2
Author:Raas
Date:2019-07-18 14:23:57
 

  1. Errors on login_with_linkedin2.php...   Reply   Report abuse  
Picture of Raas Raas - 2019-07-18 14:23:57

On both the sample files, I am taken to the linked in page where I enter my linkedin password and authorize my web app.

Yes, I have 2 redirectURLs configured.

On both, I get the following exact same error:


Error: it was not possible to access the API call: it was returned an unexpected response status 410 Response: { "errorCode": 0, "message": "This resource is no longer available under v1 APIs", "requestId": "***masked by me***", "status": 410, "timestamp": 1563459674802 }

So I am guessing the class and/or sample files are for Oauth1. What changes do I need to make for Oauth2?

Thanks in advance!

  2. Re: Errors on login_with_linkedin2.php...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2019-07-19 00:45:42 - In reply to message 1 from Raas
Well LinkedIn2 no longer supports version 1 of their API. You can only make calls to version 2 of the API.

To make the class work you need to change the following lines in the oauth_configuration.json file.

I have updated the package in the PHP Classes site to provide the new configuration values.

You also need to change the API calls in the example script so it work wih LinkedIn API v2.

Can you let me know if it works for you now?

"LinkedIn2":
{
"oauth_version": "2.0",
"dialog_url": "https://www.linkedin.com/oauth/v2/authorization?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&scope={SCOPE}&response_type=code&state={STATE}",
"access_token_url": "https://www.linkedin.com/oauth/v2/accessToken",
"default_access_token_type": "Bearer"
},

 
For more information send a message to info at phpclasses dot org.