Skip to content

AmirMustafa/LinkedIn-API-Login-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn API client in PHP

Latest Version Software License Build Status SensioLabsInsight Code Coverage Quality Score Total Downloads

A PHP library to handle authentication and communication with LinkedIn API. The library/SDK helps you to get an access token and when authenticated it helps you to send API requests. You will not get everything for free though... You have to read the [LinkedIn documentation][api-doc-core] to understand how you should query the API.

To get an overview what this library actually is doing for you. Take a look at the authentication page from the [API docs][api-doc-authentication].




Screenshot of LinkedIn Basic Data Flow


LinkedIn Apps Creation

To access LinkedIn API you need to create LinkedIn App and specify App ID(linkedinApiKey) & App Secret(linkedinApiSecret) at the time of call LinkedIn API. Follow the step-by-step guide to creating and configure a LinkedIn App from the App Dashboard.

Log in with your LinkedIn account and go to the LinkedIn App Dashboard. Create a new LinkedIn apps with your desired name (like Amir). If you want to test LinkedIn login at the localhost server, then your App Domains should be localhost. Also, localhost domain will only work, once you add platform. For add a platform click on Settings link from the left side menu panel » Click on the Add Platform button » Choose Website category » Enter site URL. Once you completed the above steps, your apps settings page would something like the below.

Installation

  1. Clone the Repository.
  2. Import users.sql file through phpMyAdmin
  3. Open the config.php file and specify the $linkedinApiKey, $linkedinApiSecret, and $callbackURL as per your LinkedIn App credentials.

  4. Browse the index.php file in the browser and test the Login with LinkedIn functionality.

Snippets

$baseURL = 'http://w3tweaks.com/linkedinlogin/';				// base or site url is the site where code 																		linked in button is kept for signup
$callbackURL = 'http://w3tweaks.com/linkedinlogin/process.php';	//callback or redirect url is the page you 																	want to open after successful getting of data
																//i.e. index.php page (must be same in linkedin dashboard)
$linkedinApiKey = '81zcng0zmoae54';								//APP ID(will receive from linkedin dashboard)
$linkedinApiSecret = '4XRzuLanwsuy9JoA';						//APP Client 
$linkedinScope = 'r_basicprofile r_emailaddress';				//This is fixed no need to change
?>

Tricks

In the LinkedIn App Dashboard:
1. Site Url / Mobile Site Url is the page where ln login button exists and
2. OAuth redirect URIs / Callback URI's is the page you want to get into after successful login(i.e. Website Home Login page => index.php) and this should be same as redirect url in config.php code

Preview

Screenshot of LinkedIn Login API Page 1


Screenshot of LinkedIn Login API Page 2


Screenshot of LinkedIn Login API Page 3


Screenshot of LinkedIn Login API Page 4


Screenshot of LinkedIn APP Dashboard


Screenshot of LinkedIn APP Dashboard

Screenshot of LinkedIn APP Dashboard


Screenshot of LinkedIn APP Dashboard




License

(The MIT License)

Copyright (c) 2016 Amir Mustafa

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A library to connect with LinkedIn API. Perfect if you are looking for an API client or SDK for LinkedIn. https://developer.linkedin.com/docs/signin-with-linkedin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published