Want To Be A Blogger  →  Start A Blog  →  Increase Traffic  →  Make Money Online  →  Recommended Things

Login With LinkedIn Using PHP

Friday, Dec 15, 2017

Tags:- PHP


In this tutorial we will show you how to do login with LinkedIn using PHP with simple and easy to integrate code provided by LinkedIn you will need to create an application on linkedin to do login from your website. You may also like login with google using PHP.


Login With LinkedIn Using PHP


To Login With LinkedIn Using PHP It Takes Only Two Steps:-

  1. Create a LinkedIn Application and get all the details
  2. Make a PHP file to login with LinkedIn


Step 1.Create a LinkedIn Application and get all the details

Create a new LinkedIn application from here https://www.linkedin.com/secure/developer. Fill all the details and after submit the form get your API key and Secret Key from linkedin.Then edit the config.php file and enter your details like url, callback url, key, secret etc. You may also like login with facebook using PHP.



Step 2.Make a PHP file to login with LinkedIn

We make a PHP file and save it with a name linkedin_login.php

<?php
session_start();
include_once 'oAuth/config.php';
include_once 'oAuth/linkedinoAuth.php';

$linkedin = new LinkedIn($config['linkedin_access'], $config['linkedin_secret'], $config['base_url'] . 'linkedin_login_oauth/linkedinauth.php' );

$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
header("Location: " . $linkedin->generateAuthorizeUrl());
?>

In this step we insert all the required files and create a new linkedin objects and then get access token and generateAuthorizeUrl for logging in to linkedin.You may also like login with twitter using PHP.



Thats all, this is how to do login with linkedin using PHP.You can customize this code further as per your requirement. And please feel free to give comments on this tutorial.

Subscribe Our Newsletter And Get Tutorials And Offers Via Email

About Me


Hello, My Name is Mudit Jain. I am a Web Developer, Professional Blogger and Digital Marketer from India. I am the founder of TalkersCode. I started this blog in february 2015 to help web developers & bloggers by providing easy and best tutorials, articles and offers for web developers and bloggers.