bannerColor WARNING_YELLOW templateName stackForums

Using the PHP OAuth library at code.google.com for LinkedIn

67 posts / 0 new
Last post
Anonymous (not verified)
Jan 14, 2010
Using the PHP OAuth library at code.google.com for LinkedIn

Hi Everyone,We've noticed that there are still some people having trouble using the PHP OAuth library at http://oauth.googlecode.com/svn/code/php/This is a great library as it has very few dependencies for you to work out.I spent some time today writing some very basic examples for walking through the OAuth authorization flow (in out of band mode), requesting your own profile, and setting your status using this API.Attached to this message you'll find a ZIP with a few files:

  • linkedin.php - boiler plate code to interface with API. Contains the OAuth hooks and some basic functions for profile and status. Easy to extend further. No XML interpretation or persistence supplied.
  • testLinkedinOauth.php - an example script for working with linkedin.php -- supply your keys to this, and execute the script on the command line.
    • It will perform the requestToken step, then present you with an authorization URL for you to copy & paste into your browser.
    • Then go through the login flow and you'll be presented with the oauth_verifier PIN code. Copy this.
    • Back to the PHP script, it'll prompt you for the oauth_verifier, paste it in.
    • Now the script will request the XML for your profile, and also set your LinkedIn status to "setting my status with the LinkedIn API
  • testWithAcessToken.php - an example script just like the one above, except it allows you to use a pre-prepared access token and secret
  • A recent version of the OAuth library this is all based on

I hope this helps you PHP developers! A caveat: I'm not a native speaker of PHP, so my apologies for the lack of idiomatic code.Thanks,Taylor
LinkedInOauth-PHP-WithSearch.zip

Joined: 2010-01-13
Jan 14, 2010

Is there a way to grab individual fields from the output array?For example, if a profile has let's say 2 educational institutions...how could I grab both instances (institution, start, end dates, etc.) individually?Same would go for past jobs/projects.

Anonymous (not verified)
Jan 15, 2010

With Field Selectors you can specify which top-level components you want from a profile.. like positions and educations: http://api.linkedin.com/v1/people/~:(positions,educations) but you can't specify any further depth than that or specify the amount of inner records you would like.As for what data is returned by the API: you're limited to the views of data we've implemented for the APIs. For the "current member" you can get all past positions and educations for the member. They'll be returned to you just by asking for positions or educations.The Connections API call will return to you only the "current" position for the member and the most recent education. You are also limited to this same amount of data for any LinkedIn member who is not the "current user." Taylor

Pascal Morin's picture
Joined: 2010-01-20
Jan 20, 2010

Thanks, thats' a great time saver and is worth clear and concise doc.

Clinton Paquin's picture
Joined: 2010-02-03
Feb 3, 2010

setup my key/secret but get the following:oauth_token=xxxxxxxxxxxx&oauth_token_secret=xxxxxxxxxxxxxxxxx&oauth_callback_confirmed=true Authorization URL: https://api.linkedin.com/uas/oauth/authorize?oauth_token=xxxxxxxxxxxxxxxxxxxxxxxxx  Enter OAuth Verifier: oauth_problem=permission_unknown    401   1265246847429   0000   [unauthorized]. The token used in the OAuth request is not valid       401   1265246847429   0000   [unauthorized]. The token used in the OAuth request is not valid  Setting status... setting my status using the LinkedIn API.     401   1265246847569   0000   [unauthorized]. The token used in the OAuth request is not valid       401   1265246847569   0000   [unauthorized]. The token used in the OAuth request is not validShould I expect to wait a certain amount of time after I create the key/secret to use this?

Joined: 2010-01-08
Feb 3, 2010

I'm using the same php library with success.  One thing to check is your machine/server time is correct.

Clinton Paquin's picture
Joined: 2010-02-03
Feb 4, 2010

I see that the timestamp from my server needs to be within 5 minutes of the server at LinkedIn (kind of a silly requirement it seems).  Is there anyway to check the timestamp at linkedin without using the API?!  I use a shared server, timestamp seems 100% accurate to me.

Anonymous (not verified)
Feb 4, 2010

Hi Clinton,We return a epoch timestamp in milliseconds (not seconds) with every failed response to our servers as an XML document in the response body. Our clocks are regularly synced to a very reliable NTP server.Taylor

Clinton Paquin's picture
Joined: 2010-02-03
Feb 4, 2010

Perfect, I posted my response body - but I'm not seeing the timestamp.  Am I missing something here?!

Muthukumar Subramaniam's picture
Joined: 2010-02-02
Feb 5, 2010

hi,can you please help me with the php library for oauth that you are using.. i want to use Search API but not able to do so.. i have succesfully feched profile using the api but i am not able to get the search in place...ca you please help me with the php class oauth lib that you have with so that i can use to get the output.. please help me... your help would be appreciated to an extent.. pleasemail me to muthukumar9@gmail.comregards,muthukumar

Joined: 2010-03-09
Mar 11, 2010

Hi Clinton,I am new to Linked In API. I want to search the user profile based on the various criteria like name, group, etc.I am getting the same out put as yours.The o/p is

oauth_token=xxxxxxxxxxxxxxxxxxxxx&oauth_token_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&oauth_callback_confirmed=trueAuthorization URL: https://api.linkedin.com/uas/oauth/authorize?oauth_token=xxxxxxxxxxxxxxxxxxxxxxxxx Enter OAuth Verifier:oauth_problem=permission_unknown 401 1268371588135 0000 [unauthorized]. The token used in the OAuth request is not valid 401 1268371588135 0000 [unauthorized]. The token used in the OAuth request is not valid Setting status... setting my status using the LinkedIn API. Curl error: malformedPerforming search for: ?company=Google&count=10 401 1268371588936 0000 [unauthorized]. The token used in the OAuth request is not valid 401 1268371588936 0000 [unauthorized]. The token used in the OAuth request is not valid

Please help me to solve this problem.

Joined: 2010-03-09
Mar 16, 2010

Hi clinton,I am getting the same output.Was the problem with timestamp?Can you please help me to solve this?Your help will be greatly appriciated.

Anonymous (not verified)
Feb 5, 2010

Added an example for using the LinkedIn Search API, as well as a shortcut to make use of pre-prepared access tokens. Taylor

Clinton Paquin's picture
Joined: 2010-02-03
Feb 5, 2010

Not sure I follow you Taylor.  Where did you add the example?

Anonymous (not verified)
Feb 5, 2010

In the ZIP file attached to the top-most post of this topic.

David Whalen's picture
Joined: 2010-02-06
Feb 6, 2010

Hi Taylor.I'm trying your exact example in the ZIP and I'm getting a 401 when I call getProfile:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
  <status>401</status>
  <timestamp>1265512856802</timestamp>
  <error-code>0000</error-code>
  <message>[unauthorized]. The token used in the OAuth request is not valid</message>
</error>
 

This is using your OAuth.php and your linkedin.php. I'm using a web page with a callback.  Here's page 1:$callback_addr = "http://mywebsite.com/this/that/callback/";$connection = new LinkedIn($config['app_token'], $config['app_token_secret'], $callback_addr);$connection->getRequestToken();$url = $connection->generateAuthorizeUrl();header('Location: ' . $url);The LinkedIn authorization page comes up as expected.  I log-in, and the callback page is called.Here's the code: $connection = new LinkedIn($config['app_token'], $config['app_token_secret']); $connection->getAccessToken($_REQUEST['oauth_verifier']); $data = $connection->getProfile('~:(id,first-name,last-name)'); print_r($data);Any ideas?  Again this is using the files in the ZIP.Thanks,DW

Anonymous (not verified)
Feb 8, 2010

You'll have to forgive my knowledge of PHP: I treat it like a console scripting language, so as soon as you make it "active" on a web page, my PHP knowledge becomes pretty useless. One of the reasons I chose the out of band approach for my examples was such that there were no worries about persistent storage.. the entire duration of the request could be represented in a single execution of the script.That said, here's what I think you need to:After performing the requestToken step, you need to persist, either in the session, a memcache, or the DB, your request token and request token secret. You need to hold onto that until you've finished the access token step.When you callback is executed, you need to reinstantiate the LinkedIn object (as you're already doing) but then also setup the LinkedIn object to still be aware of the original request token values -- assuming you've places the request token and request token secret into a hash called $stored_params:

$connection->request_token = new OAuthConsumer($stored_params['oauth_token'], $stored_params['oauth_token_secret'], 1);

Now that your callback $connection object has the persisted values from the request token step, it's capable of asking for an access token with your OAuth verifier:

$connection->getAccessToken($_REQUEST['oauth_verifier']);

Hope that this helps! The error message you are getting back is specifically telling you that in your request for an access token, there's no "request token" included -- so it has no way to figure out what access token it should be giving you.Taylor

Roy Rodenstein's picture
Joined: 2010-02-25
Feb 25, 2010

Hi Taylor,Your sample code (plus the Google library) was super helpful, thanks!As far as the persistence, I am using the PHP $_SESSION variable which works fine.One note, it looks to me like there are a couple of small bugs in the setStatus() function of linkedin.php1) the $xml variable is missing the <?xml etc. preamble. Probably not a big deal but the API docs say to include it.2) more importantly, the $xml variable is never actually used after it is set... so I don't think this function is actually setting your status ?  I think it's  the httpRequest call that is missing the $xml parameter?3) Also, the httpRequest call references profile_url, which is not defined in the setStatus() function... it seems to be a carry-over from the getProfile() function? And it specifies GET vs. PUT as the http method.4) Lastly, there are some lines commented out in getProfile() to tweak the $auth_header that seem necessary for actually setting the status?Below is my modified code which finally worked and updated my status, in case it's helpful. Regards, Royfunction setStatus($status) {    $status_url = $this->base_url . "/v1/people/~/current-status";    echo "Setting status...\n";    $xml = "<?xml version='1.0' encoding='UTF-8'?><current-status>" . htmlspecialchars($status, ENT_NOQUOTES, "UTF-8") . "</current-status>";    echo $xml . "\n";    $request = OAuthRequest::from_consumer_and_token($this->consumer, $this->access_token, "PUT", $status_url);$request->sign_request($this->signature_method, $this->consumer, $this->access_token);$auth_header = $request->to_header("https://api.linkedin.com");    # Make sure there is a space and not a comma after OAuth    $auth_header = preg_replace("/Authorization\: OAuth\,/", "Authorization: OAuth ", $auth_header);    # Make sure there is a space between OAuth attribute    $auth_header = preg_replace('/\"\,/', '", ', $auth_header);    if ($debug) {      echo $auth_header . "\n";    }    $response = $this->httpRequest($status_url, $auth_header, "PUT", $xml);    return $response;  }

Anonymous (not verified)
Mar 2, 2010

It will take some time for us to get time to work on this PHP code.Would people be interested in pushing a copy of this onto github so the community can improve on it?

Roy Rodenstein's picture
Joined: 2010-02-25
Mar 8, 2010

Hi Paul,Definitely. I am finishing up my app and will post the code on github and then reply here to let folks know.Best,Roy (@royrod)

Anonymous (not verified)
Mar 9, 2010

That's great, I'd like to see the community step up and maintain this.Thanks!

Jimmy Tidey's picture
Joined: 2010-05-24
May 24, 2010

I'm having great difficulty with this. I definitely have the correct server time. I cannot run testLinkedinOauth.php from the command line (it gives me an error), but if I run it in the browser I get a url that I can follow, which allows me to give the app permission. I then get a pin number. What to do with it? setting $oauth_verifier = pin doesn't seem to work, am I missing something ? Any help much appreciated!

Anonymous (not verified)
May 25, 2010

The PIN (aka oauth_verifier) is sent to api.linkedin.com/uas/oauth/accessToken endpoint to finalize the authorization and obtain the access token&secret.  This request is done the same way as the requestToken request.

Jimmy Tidey's picture
Joined: 2010-05-24
May 25, 2010

Hi,Thanks for getting back to me. Currently, I call$linkedin->getAccessToken($oauth_verifier);Where I've set $oauth_verifier to the PIN is was given.If print_r($linkedin->access_token) I get

OAuthConsumer Object(    [key] =>     [secret] =>     [callback_url] => 1)Which I presume means the pin has failed to get me a Key and Secret. Does that sound like a plausible diagnosis? Again, I'm very stuck with this, so any hints a very helpful! 
- -
Joined: 2010-06-08
Jun 8, 2010

Thanks for your efforts but I was not able to get this example full working.Here's a basic working PHP class I found on github: http://github.com/w3guru/Linkedin-API-PHP-class

Joined: 2010-02-09
Mar 9, 2010

This is very helpful, thank you.  I still haven't figured out what I'm doing, but I'm starting to see the light.I'm not sure if this would be helpful to others, or if this is hidden somewhere in the example, but this would be my Hello World application.  If someone can provide this, I suspect that would be a big help to a lot of people.  If I can figure this out, I'll share my code:1) Two PHP files.  One called getAccessKey.php and another called useAccessKey.php2) At the top of each file, there are a clearly documented variables to put your Application API Key and Secret3) getAccessKey.php uses OAuth to get a user's oauth token and secret.  This is simply printed to the screen.4) useAccessKey.php has an HTML Form (or has clearly documented variables) for the user's oauth token and secret5) useAccessKey.php uses this info to get data of some kind (Network Updates perhaps) and parses it into an ArrayI realize all of this is probably in there somewhere, I'm starting to sift through the examples folder, and also look at other samples people have posted, but it's not really clear where to put some of this stuff.  I use and love php command line, but I suspect that many php developers don't use this (I could be mistaken).  If I had a simple example like I outlined above, I would have been able to start writing my app within 10 minutes of getting my API key. Tyson

Muthukumar Subramaniam's picture
Joined: 2010-02-02
Mar 9, 2010

Hi Tyson,I was not able to understand much about your file structure and the way you are trying to use OAuth in LinkedIn with the 2 files that you have created.I'll explain you the flow to use OAuth in LinkedIn and probably you can then figure out how to use it in your application.As you already know with some research that OAuth has some basic steps to be followed.1. Using the Comsumer keys (API Key and API Secret key) provided by LinkedIn you get your Request Token.2. Fetching OAuth token and token secret - called Access Token through which you can use the services that are provided by LinkedIn under the throttle limits.The following are the steps that needs to be followed.1. Using the consumer keys that you have with you, you first REQUEST LinkedIn to give me Access Token, there is a url where you need to send this request to.2. LinkedIn checks your keys and redirects you to Authorize page, where you are authenticated with LinkedIn username and password.3. After authentication, you have to specify your REDIRECT url so that once any user authenticates himself, he should be re-directed to some page of your wish.4. Now, after authentication while sending the response from LinkedIn, it also sends ACCESS token for the particular authentication that had taken place which then can use used while you make calls using LinkedIn API.I know that while at the start all these words seems to be strange, but then as you start working on these and build your headers, base string, signatures and request to the url that LinkedIn has provided with, you will get the knack of the flow that needs to be followed.I hope that this clears few questions that you have and might help you in your project.You can review and then try to use this knowledge, incase if you have any more questions feel free to ask and I will reply you as soon as possible.Have a great day!Regards,Muthukumar

Joined: 2010-03-09
Mar 16, 2010

Hi All,I am new to linked in API. I want to use search API in my application.I am having contacts table which stores the number of contacts.I am having my contact list.What I want is to have one column as 'view linked in profile' an image for each contact.Clikcing on which, the linked in profile should get displayed.is possible using linkedin apis?I have created api and secrete key and authenticated. I used the example you attached.I can access the current user profile, but how do I access the profile of others?I have googled a lot but no luck..Please help.

Doug Young's picture
Joined: 2010-03-01
Mar 31, 2010

Taylor, I'm trying to expand your linkedin.php functions to hanlde the x-li-auth-token for viewing out of network profiles. I've tried many different approaches, and none work sofar. I see others asking about this, but haven't found an example that seems correct.  I've extracted the token and have something like   'x-li-auth-token: OUT_OF_NETWORK:abcd', which I'm passing to the httpRequest function as an additional arg, but it seems to have no effect. The problem I'm trying to solve is that I'm not getting the same amount of detail from the API as I see when I'm simply viewing the same profile on linkedin. I assume this is due to the authtoken. Any suggestions?function httpRequest($url, $auth_header, $method, $body = NULL, $auth=NULL) {    if (!$method) {      $method = "GET";    };    $curl = curl_init();      ....    curl_setopt($curl, CURLOPT_HTTPHEADER, array($auth_header)); // Set the headers.                                                           curl_setopt($curl, CURLOPT_HTTPHEADER, $auth); // Set extra x-li-auth token

rathindra singha's picture
Joined: 2010-07-08
Jul 8, 2010

Can anyone help me to display Connections List of any user using oauth PHP...I want to display the friends list with their profile image.Regards fromRathiN

Joined: 2010-07-12
Jul 12, 2010

I'm using this library, but every time I go to get the request token it returns nothing. absolutely nothing, not even an error.The server stats are these:PHP 5.2 on Windows Server 2008 running IIS with PHP in FastCGI modeThe clocks are set to central time and syncs with microsoft's time server, so I don't think the clock is the issue. Any help here would be really appeciates as I've been at this all day wtih no luck!

Adam Trachtenberg's picture
LinkedIn Employee
Joined: 2011-06-30
Jul 12, 2010

Jordan --Sorry to hear you're having issues -- I hate debugging these types of things because it seems like you're just banging away at it with no luck and making no progress -- even though you are.We'll need a little more than this is to help debug. Does the request just hang? There must be some timeout error or HTTP status code reply... -adam

Joined: 2010-07-12
Jul 12, 2010

I modified the getRequestToken function to output the URL it's using to request the token and the response from the server. Here's what I got:URL:  https://api.linkedin.com/uas/oauth/requestToken?oauth_callback=oob&oauth_consumer_key=<my key>&oauth_nonce=<some string>&oauth_signature=<another string>&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1278972255&oauth_version=1.0Response: //literally nothing from a print_rAuthorization URL:  https://api.linkedin.com/uas/oauth/authorize?oauth_token= //obviously going to failMy server is sending me a 200 OK message, so it doesn't know something's wrong, and the response is faster than API calls to Facebook. However the request does complete, it just doesn't return anything, so the code executes with a blank token.If I show the $request_token variable after the request, it shows this: OAuthConsumer[key=,secret=] with nothing after the = signs.

Adam Trachtenberg's picture
LinkedIn Employee
Joined: 2011-06-30
Jul 12, 2010

Are you using the ZIP file from the top of this thread? I expect Taylor assumed you'd be using this from the command line, which I agree is odd. Which file are you executing? I'll need to futz around with this a bit to get it working better from a web server.

Joined: 2010-07-12
Jul 13, 2010

I'm running the auth.php file from here: http://thinkdiff.net/linkedin/integrate-linkedin-api-in-your-site/ which uses this library, specifically linkedin.phpIf I run the testLinkedinOauth.php file, it times out. (possibly because I'm not authenticated with the Linkedin service) Commenting out the setting of the status and the search functions doesn't help it (I've had problems with Facebook doing a lot of API calls in a script).I modified the function to get the request token in linkedin.php to show me each step what's being returned, and everything looks fine up until Linkedin returns the token.Thanks for your help with this. I really appreciate it since this is the last third-party API I have to interface with for my job, and so far it's been the hardest!

Joined: 2010-09-02
Oct 12, 2010

Hi Adam,I am also getting the same response as Jordan above. I am using the testLinkedinOauth.php file to test.The getRequestToken() call gets executed nut nothing is returned back. When I print the response both the token and secret are empty.And the Authorization URL: https://api.linkedin.com/uas/oauth/authorize?oauth_token=I havr commented the rest of the code. The only code that gets executed id :$consumer_key = "my key";$consumer_secret = "my secret";if(!isset($_GET['a'])){# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback$linkedin = new LinkedIn($consumer_key, $consumer_secret, "http://domain.com?a=cb");$linkedin->debug = true; # Now we retrieve a request token. It will be set as $linkedin->request_token$linkedin->getRequestToken();//echo "".$linkedin->request_token;print_r($linkedin);# With a request token in hand, we can generate an authorization URL, which we'll direct the user toecho "Authorization URL: " . $linkedin->generateAuthorizeUrl() . "\n\n";}Can you please help me...

Iñaki Arenaza's picture
Joined: 2010-07-21
Jul 21, 2010

Hi Taylor,I'd like to use your linkedin.php library in an open source project (licensed under the GPL v3). I know OAuth.php comes with a MIT license, but I don't know which license is used for linkedin.php. I need to be sure that it's a GPL (v3) compatible one, otherwise I won't be able to use it.Thanks in advance.Iñaki.

Boon Kgim Khur's picture
Joined: 2010-11-05
Nov 9, 2010

Yo all,Just a sharing.  For those who are interested in knowing how to implement oAuth using some of the most basics PHP functions like fsockopen() without dependency on any standard OAuth library, I have posted what I found out as a step-by-step guide @ http://blog.thewebcafes.com/post/1502524959/php-step-by-step-oauth-for-dummies-based-on-linkedin.Feel free to comment there.

Timothy Barnes's picture
Joined: 2009-12-26
Nov 24, 2010

For the longest time I was wondering why this PHP lib wouldn't work out of the box. I finally had a chance to take a look at the posts in greater detail and noticed it was written for a console. SO I thought I would take a stab at getting the sessions to persist.If you're having trouble getting this to work, then here is a really terrible hack job zip file just to get you started. Should work once you get the keys put in the right places. See the attached file.By no means is this an example of how you ACTUALLY should be coding it since there are serious security flaws in this one. Feel free to skip the crummy tutorial below.OK Lets begin!Start with start-test.php. You will need to replace the consumer secret and key accordingly. You can find that in your application settings. As you can see, I took code from the zip file that Tom made and I butchered it. This script will get your app to connect to linked in.File: start-test.php

<?phprequire_once 'linkedin.php'; $consumer_key = "YOUR API Key HERE";$consumer_secret = "YOUR Secret Key HERE";$return_url = "http://YOURWEBSITEHERE_COM/return.php";
echo "<pre>";
 
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback$linkedin = new LinkedIn($consumer_key, $consumer_secret, $return_url);$linkedin->debug = true;
 # Now we retrieve a request token. It will be set as $linkedin->request_token$linkedin->getRequestToken();
 # With a request token in hand, we can generate an authorization URL, which we'll direct the user toecho "Authorization URL: <a href='" . $linkedin->generateAuthorizeUrl() . "'>Authorize...</a>\n\n";
 # After logging in, the user will be presented with an OAuth Verifier, which you would then ask the member to enter in a UI you present. Once you have the OAuth verifier, set it here:print_r($linkedin);
 
$filename = $linkedin->request_token->key; // Make a filename out of the request tokenfile_put_contents("keys/" . $filename . ".txt", serialize($linkedin)); // Store the object in a file so we can pull it later
?>

Make sure you also change the key and secret around in return.phpFile: return.php

<?php
require_once 'linkedin.php';

# Use this to used already retrieved access token credentials for testing.
$consumer_key = "YOUR API Key HERE";
$consumer_secret = "YOUR Secret Key HERE";


echo "<pre>";
$linkedin = unserialize(file_get_contents("keys/" . $_GET["oauth_token"] . ".txt")); // Pull the object we stored in start-test.php
$linkedin->getAccessToken($_GET["oauth_verifier"]); // set the verifier so we can activate the $linkedin object


// This should finally work
# Let's do a search!
$xml_response = $linkedin->getProfile("~:(id,first-name,last-name,headline,picture-url)");

echo $xml_response;
?>

And there you have it. It should print out some of your user info...To recap, here is the workflow:

  1. Once your keys and $return_url is set, load up start-test.php. (example: http://your-website-lol.com/start-test.php)
  2. start-test.php will present an "Authorize..." link and a dump of the current $linkedin object.
  3. Click on the "Authorize..." link and it will take you to linkedin.com. Linkedin will prompt you to connect the application.
  4. Once you connect the application it will return you to return.php (example: http://your-website-lol.com/return.php?oauth_token=...&oauth_verifier=...)
  5. return.php will load the $linkedin object persisted from start-test.php and will display profile information
  6. Hooray!

Just so you guys know I just figured this out maybe 30 minutes ago. Figured I'd post this here to save a few developers from putting their fist through a computer. Enjoy.

Joined: 2011-01-31
Feb 1, 2011

Hi, thank you for first working example :o) I am just wondering if there is a way how to perform search without login_to_allow_access procedure for user who wants to see data?I just want to see if there is someone with the name "John Walker" on linkedin plus to see his picture.Is this possible? Facebook allows this search without asking user to accept some connection.Thank you for any reply.

Kirsten Hunter's picture
Joined: 2011-06-30
Feb 1, 2011

All LinkedIn API requests require an authenticated user - there are no resources which can be accessed without a user token.Thanks,Kirsten

Joined: 2011-01-31
Feb 1, 2011

OK, I see this from all examples but when I enter my name to server pipl.com, they show me my profile information stored on linkedin.com even without my authorization.I would like to perform similar search.Do you have any idea how they do it?

Kirsten Hunter's picture
Joined: 2011-06-30
Mar 10, 2011

I'm pretty sure pipl.com is just leveraging Google's search of the public profiles.

Abderrahmane Tahri Jouti's picture
Joined: 2011-01-17
Mar 10, 2011

Hey,Thanks a lot for developing this library.well it is working just fine in RAW PHP, but I'm actually using it in an CodeIgniter application and it wont work :/

Joined: 2011-05-02
May 2, 2011

Hello Everyone,I am using  Api to integrate linkedin in my website. Now my requirement is How can i achieve this task if i want to authenticate user without redirecting to Linkedin site?Like back end process. As Faccebook api has that get permanent session key and than you can utilize that session key on every time. It will never redirect to facebook.Is there any way to get permanent key like mechanism facebook providing to login directly into linkedin and access information?Thanks in advance.Santosh

Kirsten Hunter's picture
Joined: 2011-06-30
May 2, 2011

I believe that the Facebook API always requires the user to login to facebook at least once to verify that the third party application has permission to use the API on their behalf, and LinkedIn follows this model as well.  Once the user has given their permission, you can continue to use the access token as long as the user has not revoked access.  There is, however, no way around the LinkedIn authorization step for third party applications - this is a requirement of our authentication model, that the user only give their username and password to us directly.

Kirsten Hunter's picture
Joined: 2011-06-30
May 2, 2011

I should also mention that it is considered bad forum manners to post the same question to several threads which are unrelated to the specific question. There are users in this forum who get emails on every message to the forum, and it is disrespectful to fill their email boxes with inappropriate messages. If you don't see an appropriate thread, please start a new question and wait until it gets answered.  I've deleted all of your other identical questions.Please follow good forum etiquette, thanks!

Joined: 2011-05-02
May 2, 2011

Hi,Thanks for reply,But i am not satisfied completly, Is there any demo code where i could login but it don't go to the LinkedIn site.I want to see any demo for this or any other code if  you have please provide me.ThanksSantosh

Kirsten Hunter's picture
Joined: 2011-06-30
May 2, 2011

I'm sorry if my answer was unclear.  There is no way to authenticate a user without logging in via the LinkedIn website.

Frederik Goddeeris's picture
Joined: 2011-07-19
- (Reply to #49) Aug 1, 2011

Could someone upload these scripts again? (they are offline)
There are exactly what i'm looking for.

Thanks in advance,
Frederik

Tek NM's picture
Joined: 2011-08-22
Aug 22, 2011

The download link for LinkedInOauth-PHP-WithSearch.zip is not working .. where i can download this

Pages