{"id":559,"date":"2015-04-28T20:24:42","date_gmt":"2015-04-28T20:24:42","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=559"},"modified":"2022-11-13T06:53:44","modified_gmt":"2022-11-13T06:53:44","slug":"login-with-linkedin-using-php","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/","title":{"rendered":"Login with LinkedIn using PHP"},"content":{"rendered":"<p>LinkedIn is one of the most popular social networks with a huge user base. Like the <a href=\"http:\/\/www.codexworld.com\/login-with-facebook-using-php\/\">Facebook<\/a>, <a href=\"http:\/\/www.codexworld.com\/login-with-twitter-using-php\/\">Twitter<\/a> and <a href=\"http:\/\/www.codexworld.com\/login-with-google-api-using-php\/\">Google<\/a> authentication, LinkedIn also used for the user authentication in the web application. If you want to allow the user to login with the social account in the website, LinkedIn login option can provide additional value to social login system. <b>Sign In with LinkedIn<\/b> feature allows the user to log into the web application using their LinkedIn account without creating a new account.<\/p>\n<p><b>LinkedIn API<\/b> helps to authenticate and access user&#8217;s account information in the web application. You can easily integrate LinkedIn Authentication using PHP OAuth library. OAuth library allows you to connect LinkedIn API and implement Login with LinkedIn account using PHP. In this tutorial, we will show you how to integrate user registration and login system with LinkedIn using PHP and store the LinkedIn account data in the MySQL database. Our example LinkedIn login script uses <b>PHP OAuth 2.0 and LinkedIn login API v2<\/b> to build LinkedIn login system with PHP and MySQL.<\/p>\n<p>Before you begin to integrate <b>Sign In with LinkedIn using PHP<\/b>, take a look at the file structure.<\/p>\n<pre class=\"file-struc\">linkedin_login_with_php<span style=\"color:#794938\">\/<\/span>\r\n\u251c\u2500\u2500 config.php\r\n\u251c\u2500\u2500 index.php\r\n\u251c\u2500\u2500 logout.php\r\n\u251c\u2500\u2500 User.class.php\r\n\u251c\u2500\u2500 linkedin-oauth-client-php<span style=\"color:#794938\">\/<\/span>\r\n\u251c\u2500\u2500 images<span style=\"color:#794938\">\/<\/span>\r\n\u2502   \u251c\u2500\u2500 linkedin-sign-in-btn.png\r\n\u2514\u2500\u2500 css<span style=\"color:#794938\">\/<\/span>\r\n    \u2514\u2500\u2500 style.css\r\n<\/pre>\n<h2>Create LinkedIn App<\/h2>\n<p>To access LinkedIn API you need to create an App in the LinkedIn Developer panel. Client ID and Client Secret are required to specify at the time of calling the LinkedIn API. Follow the step-by-step guide to create a new LinkedIn App and generate <b>Client ID<\/b> and <b>Client Secret<\/b> in the LinkedIn Developers panel.<\/p>\n<ul class=\"step_list\">\n<li>Visit <a href=\"https:\/\/www.linkedin.com\/developers\/\" target=\"_blank\" rel=\"noopener noreferrer\">LinkedIn Developers page<\/a> and login with your LinkedIn account credentials.<\/li>\n<li>Click the <b>Create app<\/b> button to create a new LinkedIn app.<\/li>\n<li>Provide the information about your app and click <b>Create app<\/b> to submit the app registration form.<\/li>\n<ul class=\"bullet_disk_list\">\n<li><b>App name<\/b> &#8211; Name of the application.<\/li>\n<li><b>Company<\/b> &#8211; Name of your company.<\/li>\n<li><b>App description<\/b> &#8211; Workflow of the application.<\/li>\n<li><b>App logo<\/b> &#8211; Logo to display on the OAuth dialog.<\/li>\n<li><b>Privacy policy URL<\/b> &#8211; URL of the Privacy Policy page.<\/li>\n<li><b>Business email<\/b> &#8211; Your email address.<\/li>\n<li><b>Products<\/b> &#8211; Select the products that you&#8217;d like to add to your app.<\/li>\n<\/ul>\n<li>On successful app creation, the page will be redirected to the App settings screen.<\/li>\n<li>Switch to the <b>Auth<\/b> tab <b>\u00bb<\/b> Scroll down to <b>OAuth 2.0 settings<\/b> section.\n<ul class=\"bullet_disk_list\">\n<li>Specify the redirect URL in the <b>Redirect URLs<\/b> fields and <b>Update<\/b> the App settings.<\/li>\n<\/ul>\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3958\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-create-app-redirect-url-settings-codexworld.png\" alt=\"linkedin-php-oauth-create-app-redirect-url-settings-codexworld\" width=\"781\" height=\"289\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-create-app-redirect-url-settings-codexworld.png 781w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-create-app-redirect-url-settings-codexworld-300x111.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-create-app-redirect-url-settings-codexworld-768x284.png 768w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-create-app-redirect-url-settings-codexworld-200x74.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-create-app-redirect-url-settings-codexworld-346x128.png 346w\" sizes=\"auto, (max-width: 781px) 100vw, 781px\" \/><\/div>\n<p><span class=\"note\">Note that:<\/span> The Redirect URLs must be matched with the Redirect URL that specified in the script.<\/li>\n<li>In the <b>Application credentials<\/b> section, you will see the <b>Client ID<\/b> and <b>Client Secret<\/b> of your LinkedIn App. The App ID and App secret need to be specified in the script at the time of the LinkedIn API call.\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3960\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-api-create-app-client-id-secret-codexworld.png\" alt=\"linkedin-php-oauth-api-create-app-client-id-secret-codexworld\" width=\"894\" height=\"672\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-api-create-app-client-id-secret-codexworld.png 894w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-api-create-app-client-id-secret-codexworld-300x226.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-api-create-app-client-id-secret-codexworld-768x577.png 768w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-api-create-app-client-id-secret-codexworld-200x150.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/linkedin-php-oauth-api-create-app-client-id-secret-codexworld-306x230.png 306w\" sizes=\"auto, (max-width: 894px) 100vw, 894px\" \/><\/div>\n<\/li>\n<\/ul>\n<h2>Create Database Table<\/h2>\n<p>To store the user&#8217;s profile information from LinkedIn, a table needs to be created in the database. The following SQL creates an <code>users<\/code> table with some basic fields in the MySQL database to hold the LinkedIn account information.<\/p>\n<pre style=\"color: rgb(0, 0, 0);\"><span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">CREATE<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">TABLE<\/span> <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`users`<\/span> (\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">11<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span> AUTO_INCREMENT,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`oauth_provider`<\/span> enum(<span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">'linkedin'<\/span>,<span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">'google'<\/span>,<span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">'facebook'<\/span>,<span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">'twitter'<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">'linkedin'<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`oauth_uid`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">50<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`first_name`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">25<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`last_name`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">25<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`email`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">50<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`gender`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">10<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`locale`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">25<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`picture`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">200<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`link`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">50<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`created`<\/span> datetime <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`modified`<\/span> datetime <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n PRIMARY <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`id`<\/span>)\r\n) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">ENGINE<\/span>=<span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">InnoDB<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">CHARSET<\/span>=utf8 <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span>=utf8_unicode_ci;<\/pre>\n<h2>LinkedIn OAuth Library for PHP<\/h2>\n<p>The <code>linkedin-oauth-client-php\/<\/code> directory contains the <b>OAuth 2.0 PHP<\/b> client library for <b>LinkedIn API v2<\/b>. You don&#8217;t need to download it separately, all the required files of LinkedIn PHP OAuth are included in our LinkedIn Login PHP source code.<\/p>\n<h2>User Class (User.class.php)<\/h2>\n<p>The User class handles the database related operations (connect, insert, and update) using PHP and MySQL. It helps to connect to the database and insert\/update LinkedIn account data in the users table.<\/p>\n<ul class=\"bullet_disk_list\">\n<li><b>__construct()<\/b> \u2013 Connects to the MySQL database.<\/li>\n<li><b>checkUser()<\/b> \u2013 Insert or update the user profile data based on the OAuth provider and ID. Returns the user&#8217;s account data as an array.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php\r\n<\/span><span style=\"color: #FF8000\">\/*\r\n&nbsp;*&nbsp;User&nbsp;Class\r\n&nbsp;*&nbsp;This&nbsp;class&nbsp;is&nbsp;used&nbsp;for&nbsp;database&nbsp;related&nbsp;(connect,&nbsp;insert,&nbsp;and&nbsp;update)&nbsp;operations\r\n&nbsp;*&nbsp;@author&nbsp;&nbsp;&nbsp;&nbsp;CodexWorld.com\r\n&nbsp;*&nbsp;@url&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http:\/\/www.codexworld.com\r\n&nbsp;*&nbsp;@license&nbsp;&nbsp;&nbsp;&nbsp;http:\/\/www.codexworld.com\/license\r\n&nbsp;*\/\r\n<\/span><span style=\"color: #007700\">class&nbsp;<\/span><span style=\"color: #0000BB\">User&nbsp;<\/span><span style=\"color: #007700\">{\r\n&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;<\/span><span style=\"color: #0000BB\">$dbHost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">DB_HOST<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;<\/span><span style=\"color: #0000BB\">$dbUsername&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">DB_USERNAME<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;<\/span><span style=\"color: #0000BB\">$dbPassword&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">DB_PASSWORD<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;<\/span><span style=\"color: #0000BB\">$dbName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">DB_NAME<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;<\/span><span style=\"color: #0000BB\">$userTbl&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">DB_USER_TBL<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">__construct<\/span><span style=\"color: #007700\">(){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!isset(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">db<\/span><span style=\"color: #007700\">)){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Connect&nbsp;to&nbsp;the&nbsp;database\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$conn&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">mysqli<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">dbHost<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">dbUsername<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">dbPassword<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">dbName<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$conn<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_error<\/span><span style=\"color: #007700\">){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(<\/span><span style=\"color: #DD0000\">\"Failed&nbsp;to&nbsp;connect&nbsp;with&nbsp;MySQL:&nbsp;\"&nbsp;<\/span><span style=\"color: #007700\">.&nbsp;<\/span><span style=\"color: #0000BB\">$conn<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_error<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">db&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$conn<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">checkUser<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$userData&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;array()){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!empty(<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">)){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Check&nbsp;whether&nbsp;user&nbsp;data&nbsp;already&nbsp;exists&nbsp;in&nbsp;database\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$prevQuery&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"SELECT&nbsp;*&nbsp;FROM&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">userTbl<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"&nbsp;WHERE&nbsp;oauth_provider&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_provider'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"'&nbsp;AND&nbsp;oauth_uid&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_uid'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"'\"<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$prevResult&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$prevQuery<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$prevResult<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Update&nbsp;user&nbsp;data&nbsp;if&nbsp;already&nbsp;exists\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$query&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"UPDATE&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">userTbl<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"&nbsp;SET&nbsp;first_name&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'first_name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;last_name&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'last_name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;email&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'email'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;locale&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'locale'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;picture&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'picture'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;link&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'link'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;modified&nbsp;=&nbsp;NOW()&nbsp;WHERE&nbsp;oauth_provider&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_provider'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"'&nbsp;AND&nbsp;oauth_uid&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_uid'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"'\"<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$update&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$query<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Insert&nbsp;user&nbsp;data\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$query&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"INSERT&nbsp;INTO&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">userTbl<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"&nbsp;SET&nbsp;oauth_provider&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_provider'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;oauth_uid&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_uid'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;first_name&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'first_name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;last_name&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'last_name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;email&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'email'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;locale&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'locale'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;picture&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'picture'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;link&nbsp;=&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'link'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;created&nbsp;=&nbsp;NOW(),&nbsp;modified&nbsp;=&nbsp;NOW()\"<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$insert&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$query<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;user&nbsp;data&nbsp;from&nbsp;the&nbsp;database\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$result&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$prevQuery<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$userData&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">();\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Return&nbsp;user&nbsp;data\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">return&nbsp;<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n}<\/span><\/pre>\n<h2>Site Settings and API Configuration (config.php)<\/h2>\n<p>The database settings and LinkedIn API configuration constant variables are defined in the <code>config.php<\/code> file.<br \/>\n<b>Database Constants:<\/b><\/p>\n<ul class=\"bullet_disk_list\">\n<li>DB_HOST \u2013 Specify the database host.<\/li>\n<li>DB_USERNAME \u2013 Specify the database username.<\/li>\n<li>DB_PASSWORD \u2013 Specify the database password.<\/li>\n<li>DB_NAME \u2013 Specify the database name.<\/li>\n<li>DB_USER_TBL \u2013 Specify the table name where the user&#8217;s account data will be stored.<\/li>\n<\/ul>\n<p><b>LinkedIn API Constants:<\/b><\/p>\n<ul class=\"bullet_disk_list\">\n<li>LIN_CLIENT_ID \u2013 Specify the LinkedIn App ID.<\/li>\n<li>LIN_CLIENT_SECRET \u2013 Specify the LinkedIn App Secret.<\/li>\n<li>LIN_REDIRECT_URL \u2013 Specify the OAuth Callback URL.<\/li>\n<\/ul>\n<p><b>Call LinkedIn API:<\/b><br \/>\nThe PHP OAuth library is used to connect with LinkedIn API and working with OAuth client.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php\r\n<\/span><span style=\"color: #FF8000\">\/*\r\n&nbsp;*&nbsp;Basic&nbsp;Site&nbsp;Settings&nbsp;and&nbsp;API&nbsp;Configuration\r\n&nbsp;*\/\r\n\r\n\/\/&nbsp;Database&nbsp;configuration\r\n<\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_HOST'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Host'<\/span><span style=\"color: #007700\">);\r\n<\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_USERNAME'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Username'<\/span><span style=\"color: #007700\">);\r\n<\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_PASSWORD'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Password'<\/span><span style=\"color: #007700\">);\r\n<\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_NAME'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Name'<\/span><span style=\"color: #007700\">);\r\n<\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_USER_TBL'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'users'<\/span><span style=\"color: #007700\">);\r\n\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;LinkedIn&nbsp;API&nbsp;configuration\r\n<\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'LIN_CLIENT_ID'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'Insert_LinkedIn_App_ID'<\/span><span style=\"color: #007700\">);\r\n<\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'LIN_CLIENT_SECRET'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'Insert_LinkedIn_App_Secret'<\/span><span style=\"color: #007700\">);\r\n<\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'LIN_REDIRECT_URL'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'OAuth_Callback_URL'<\/span><span style=\"color: #007700\">);\r\n<\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'LIN_SCOPE'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'r_liteprofile&nbsp;r_emailaddress'<\/span><span style=\"color: #007700\">);&nbsp;<\/span><span style=\"color: #FF8000\">\/\/API&nbsp;permissions\r\n\r\n\/\/&nbsp;Start&nbsp;session\r\n<\/span><span style=\"color: #007700\">if(!<\/span><span style=\"color: #0000BB\">session_id<\/span><span style=\"color: #007700\">()){\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">session_start<\/span><span style=\"color: #007700\">();\r\n}\r\n\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;oauth&nbsp;client&nbsp;library\r\n<\/span><span style=\"color: #007700\">require_once&nbsp;<\/span><span style=\"color: #DD0000\">'linkedin-oauth-client-php\/http.php'<\/span><span style=\"color: #007700\">;\r\nrequire_once&nbsp;<\/span><span style=\"color: #DD0000\">'linkedin-oauth-client-php\/oauth_client.php'<\/span><span style=\"color: #007700\">;<\/span><\/pre>\n<p><span class=\"note\">Note that:<\/span> You&#8217;ll find the Client ID and Client Secret on your <b>LinkedIn App settings<\/b> page.<\/p>\n<h2>Login &amp; Get LinkedIn Account Data (index.php)<\/h2>\n<p>In this file, the LinkedIn API authentication process is handled using PHP.<\/p>\n<ul class=\"step_list\">\n<li>Initially, the authentication URL is generated and LinkedIn Sign-in button is displayed on the web page.<\/li>\n<li>If the user authenticates with their LinkedIn account, the following happens:\n<ul class=\"bullet_disk_list\">\n<li>The profile information is retrieved from the LinkedIn account using <b>LinkedIn Profile API v2<\/b> (<code>https:\/\/api.linkedin.com\/v2\/me<\/code>) and PHP.<\/li>\n<li>Call the LinkedIn API to get the member&#8217;s email address (<code>https:\/\/api.linkedin.com\/v2\/emailAddress<\/code>).<\/li>\n<li>Insert account data in the database using <b>checkUser()<\/b> function of User class.<\/li>\n<li>The user&#8217;s account info is stored in the SESSION.<\/li>\n<li>The LinkedIn profile details (OAuth ID, First Name, Last Name, Email, Picture, Link, etc.) is displayed on the webpage.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;configuration&nbsp;file\r\n<\/span><span style=\"color: #007700\">require_once&nbsp;<\/span><span style=\"color: #DD0000\">'config.php'<\/span><span style=\"color: #007700\">;\r\n\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;User&nbsp;class\r\n<\/span><span style=\"color: #007700\">require_once&nbsp;<\/span><span style=\"color: #DD0000\">'User.class.php'<\/span><span style=\"color: #007700\">;\r\n\r\n<\/span><span style=\"color: #0000BB\">$authUrl&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;\r\n\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;If&nbsp;user&nbsp;already&nbsp;verified&nbsp;\r\n<\/span><span style=\"color: #007700\">if(isset(<\/span><span style=\"color: #0000BB\">$_SESSION<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_status'<\/span><span style=\"color: #007700\">])&nbsp;&amp;&amp;&nbsp;<\/span><span style=\"color: #0000BB\">$_SESSION<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_status'<\/span><span style=\"color: #007700\">]&nbsp;==&nbsp;<\/span><span style=\"color: #DD0000\">'verified'&nbsp;<\/span><span style=\"color: #007700\">&amp;&amp;&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$_SESSION<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'userData'<\/span><span style=\"color: #007700\">])){\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Retrieve&nbsp;user's&nbsp;profile&nbsp;data&nbsp;from&nbsp;session\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$userData&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_SESSION<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'userData'<\/span><span style=\"color: #007700\">];\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Prepare&nbsp;output&nbsp;to&nbsp;show&nbsp;LinkedIn&nbsp;profile&nbsp;data\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(!empty(<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">)){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;h2&gt;LinkedIn&nbsp;Profile&nbsp;Details&lt;\/h2&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;div&nbsp;class=\"ac-data\"&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;img&nbsp;src=\"'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'picture'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'\"\/&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;p&gt;&lt;b&gt;LinkedIn&nbsp;ID:&lt;\/b&gt;&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_uid'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&lt;\/p&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;p&gt;&lt;b&gt;Name:&lt;\/b&gt;&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'first_name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'last_name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&lt;\/p&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;p&gt;&lt;b&gt;Email:&lt;\/b&gt;&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'email'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&lt;\/p&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;p&gt;&lt;b&gt;Logged&nbsp;in&nbsp;with:&lt;\/b&gt;&nbsp;LinkedIn'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'&lt;\/p&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;p&gt;&lt;b&gt;Profile&nbsp;Link:&lt;\/b&gt;&nbsp;&lt;a&nbsp;href=\"'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'link'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'\"&nbsp;target=\"_blank\"&gt;Click&nbsp;to&nbsp;visit&nbsp;LinkedIn&nbsp;page&lt;\/a&gt;&lt;\/p&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;p&gt;&lt;b&gt;Logout&nbsp;from&lt;\/b&gt;&nbsp;&lt;a&nbsp;href=\"logout.php\"&gt;LinkedIn&lt;\/a&gt;&lt;\/p&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;\/div&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n}elseif((isset(<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"oauth_init\"<\/span><span style=\"color: #007700\">])&nbsp;&amp;&amp;&nbsp;<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"oauth_init\"<\/span><span style=\"color: #007700\">]&nbsp;==&nbsp;<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">)&nbsp;||&nbsp;(isset(<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_token'<\/span><span style=\"color: #007700\">])&nbsp;&amp;&amp;&nbsp;isset(<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_verifier'<\/span><span style=\"color: #007700\">]))&nbsp;||&nbsp;(isset(<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'code'<\/span><span style=\"color: #007700\">])&nbsp;&amp;&amp;&nbsp;isset(<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'state'<\/span><span style=\"color: #007700\">]))){\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$client&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">oauth_client_class<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">client_id&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">LIN_CLIENT_ID<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">client_secret&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">LIN_CLIENT_SECRET<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">redirect_uri&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">LIN_REDIRECT_URL<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">scope&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">LIN_SCOPE<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">debug&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">debug_http&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$application_line&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">__LINE__<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">client_id<\/span><span style=\"color: #007700\">)&nbsp;==&nbsp;<\/span><span style=\"color: #0000BB\">0&nbsp;<\/span><span style=\"color: #007700\">||&nbsp;<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">client_secret<\/span><span style=\"color: #007700\">)&nbsp;==&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(<\/span><span style=\"color: #DD0000\">'Please&nbsp;go&nbsp;to&nbsp;LinkedIn&nbsp;Apps&nbsp;page&nbsp;https:\/\/www.linkedin.com\/secure\/developer?newapp=&nbsp;,&nbsp;'<\/span><span style=\"color: #007700\">.\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'create&nbsp;an&nbsp;application,&nbsp;and&nbsp;in&nbsp;the&nbsp;line&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$application_line<\/span><span style=\"color: #007700\">.\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'&nbsp;set&nbsp;the&nbsp;client_id&nbsp;to&nbsp;Consumer&nbsp;key&nbsp;and&nbsp;client_secret&nbsp;with&nbsp;Consumer&nbsp;secret.&nbsp;'<\/span><span style=\"color: #007700\">.\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'The&nbsp;Callback&nbsp;URL&nbsp;must&nbsp;be&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">redirect_uri<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'.&nbsp;Make&nbsp;sure&nbsp;you&nbsp;enable&nbsp;the&nbsp;'<\/span><span style=\"color: #007700\">.\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'necessary&nbsp;permissions&nbsp;to&nbsp;execute&nbsp;the&nbsp;API&nbsp;calls&nbsp;your&nbsp;application&nbsp;needs.'<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;If&nbsp;authentication&nbsp;returns&nbsp;success\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$success&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">Initialize<\/span><span style=\"color: #007700\">()){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if((<\/span><span style=\"color: #0000BB\">$success&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">Process<\/span><span style=\"color: #007700\">())){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authorization_error<\/span><span style=\"color: #007700\">)){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">error&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authorization_error<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$success&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">false<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}elseif(<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">access_token<\/span><span style=\"color: #007700\">)){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$success&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">CallAPI<\/span><span style=\"color: #007700\">(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'https:\/\/api.linkedin.com\/v2\/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams))'<\/span><span style=\"color: #007700\">,&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'GET'<\/span><span style=\"color: #007700\">,&nbsp;array(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'format'<\/span><span style=\"color: #007700\">=&gt;<\/span><span style=\"color: #DD0000\">'json'\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">),&nbsp;array(<\/span><span style=\"color: #DD0000\">'FailOnAccessError'<\/span><span style=\"color: #007700\">=&gt;<\/span><span style=\"color: #0000BB\">true<\/span><span style=\"color: #007700\">),&nbsp;<\/span><span style=\"color: #0000BB\">$userInfo<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$emailRes&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">CallAPI<\/span><span style=\"color: #007700\">(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'https:\/\/api.linkedin.com\/v2\/emailAddress?q=members&amp;projection=(elements*(handle~))'<\/span><span style=\"color: #007700\">,&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'GET'<\/span><span style=\"color: #007700\">,&nbsp;array(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'format'<\/span><span style=\"color: #007700\">=&gt;<\/span><span style=\"color: #DD0000\">'json'\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">),&nbsp;array(<\/span><span style=\"color: #DD0000\">'FailOnAccessError'<\/span><span style=\"color: #007700\">=&gt;<\/span><span style=\"color: #0000BB\">true<\/span><span style=\"color: #007700\">),&nbsp;<\/span><span style=\"color: #0000BB\">$userEmail<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$success&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">Finalize<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$success<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">exit<\/span><span style=\"color: #007700\">)&nbsp;exit;\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authorization_error<\/span><span style=\"color: #007700\">)){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">error&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authorization_error<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$success&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">false<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$success<\/span><span style=\"color: #007700\">){\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Initialize&nbsp;User&nbsp;class\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$user&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">User<\/span><span style=\"color: #007700\">();\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Getting&nbsp;user's&nbsp;profile&nbsp;data\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$inUserData&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;array();\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$inUserData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_uid'<\/span><span style=\"color: #007700\">]&nbsp;&nbsp;=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$userInfo<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">id<\/span><span style=\"color: #007700\">)?<\/span><span style=\"color: #0000BB\">$userInfo<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">id<\/span><span style=\"color: #007700\">:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$inUserData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'first_name'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$userInfo<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">firstName<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">localized<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">en_US<\/span><span style=\"color: #007700\">)?<\/span><span style=\"color: #0000BB\">$userInfo<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">firstName<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">localized<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">en_US<\/span><span style=\"color: #007700\">:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$inUserData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'last_name'<\/span><span style=\"color: #007700\">]&nbsp;&nbsp;=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$userInfo<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">lastName<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">localized<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">en_US<\/span><span style=\"color: #007700\">)?<\/span><span style=\"color: #0000BB\">$userInfo<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">lastName<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">localized<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">en_US<\/span><span style=\"color: #007700\">:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$inUserData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'email'<\/span><span style=\"color: #007700\">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$userEmail<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">elements<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;{<\/span><span style=\"color: #DD0000\">'handle~'<\/span><span style=\"color: #007700\">}-&gt;<\/span><span style=\"color: #0000BB\">emailAddress<\/span><span style=\"color: #007700\">)?<\/span><span style=\"color: #0000BB\">$userEmail<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">elements<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;{<\/span><span style=\"color: #DD0000\">'handle~'<\/span><span style=\"color: #007700\">}-&gt;<\/span><span style=\"color: #0000BB\">emailAddress<\/span><span style=\"color: #007700\">:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$inUserData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'picture'<\/span><span style=\"color: #007700\">]&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$userInfo<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">profilePicture<\/span><span style=\"color: #007700\">-&gt;{<\/span><span style=\"color: #DD0000\">'displayImage~'<\/span><span style=\"color: #007700\">}-&gt;<\/span><span style=\"color: #0000BB\">elements<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;<\/span><span style=\"color: #0000BB\">identifiers<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;<\/span><span style=\"color: #0000BB\">identifier<\/span><span style=\"color: #007700\">)?<\/span><span style=\"color: #0000BB\">$userInfo<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">profilePicture<\/span><span style=\"color: #007700\">-&gt;{<\/span><span style=\"color: #DD0000\">'displayImage~'<\/span><span style=\"color: #007700\">}-&gt;<\/span><span style=\"color: #0000BB\">elements<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;<\/span><span style=\"color: #0000BB\">identifiers<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;<\/span><span style=\"color: #0000BB\">identifier<\/span><span style=\"color: #007700\">:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$inUserData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'link'<\/span><span style=\"color: #007700\">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;<\/span><span style=\"color: #DD0000\">'https:\/\/www.linkedin.com\/'<\/span><span style=\"color: #007700\">;\r\n\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Insert&nbsp;or&nbsp;update&nbsp;user&nbsp;data&nbsp;to&nbsp;the&nbsp;database\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$inUserData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_provider'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;<\/span><span style=\"color: #DD0000\">'linkedin'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$userData&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$user<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">checkUser<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$inUserData<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/Storing&nbsp;user&nbsp;data&nbsp;into&nbsp;session\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$_SESSION<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'userData'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;<\/span><span style=\"color: #0000BB\">$userData<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$_SESSION<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_status'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;<\/span><span style=\"color: #DD0000\">'verified'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/Redirect&nbsp;the&nbsp;user&nbsp;back&nbsp;to&nbsp;the&nbsp;same&nbsp;page\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">header<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'Location:&nbsp;.\/'<\/span><span style=\"color: #007700\">);\r\n&nbsp;&nbsp;&nbsp;&nbsp;}else{\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;h3&nbsp;style=\"color:red\"&gt;Error&nbsp;connecting&nbsp;to&nbsp;LinkedIn!&nbsp;try&nbsp;again&nbsp;later!&lt;\/h3&gt;&lt;p&gt;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">HtmlSpecialChars<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$client<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">error<\/span><span style=\"color: #007700\">).<\/span><span style=\"color: #DD0000\">'&lt;\/p&gt;'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;}\r\n}elseif(isset(<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"oauth_problem\"<\/span><span style=\"color: #007700\">])&nbsp;&amp;&amp;&nbsp;<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"oauth_problem\"<\/span><span style=\"color: #007700\">]&nbsp;&lt;&gt;&nbsp;<\/span><span style=\"color: #DD0000\">\"\"<\/span><span style=\"color: #007700\">){\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;h3&nbsp;style=\"color:red\"&gt;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"oauth_problem\"<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&lt;\/h3&gt;'<\/span><span style=\"color: #007700\">;\r\n}else{\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$authUrl&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'?oauth_init=1'<\/span><span style=\"color: #007700\">;\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Render&nbsp;LinkedIn&nbsp;login&nbsp;button\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$output&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;a&nbsp;href=\"?oauth_init=1\"&gt;&lt;img&nbsp;src=\"images\/linkedin-sign-in-btn.png\"&gt;&lt;\/a&gt;'<\/span><span style=\"color: #007700\">;\r\n}\r\n<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n\r\n<span style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-meta\" style=\"color: rgb(174, 115, 19);\">&lt;!DOCTYPE html&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">html<\/span> <span class=\"hljs-attr\">lang<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"en\"<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">head<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">title<\/span>&gt;<\/span>Login with LinkedIn using PHP by CodexWorld<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">title<\/span>&gt;<\/span>\r\n    \r\n    <span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- Include stylesheet file --&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">link<\/span> <span class=\"hljs-attr\">rel<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"stylesheet\"<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"css\/style.css\"<\/span>\/&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">head<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">body<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"container\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"in-box\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- Display login button \/ profile information --&gt;<\/span>\r\n        <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$output<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">body<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">html<\/span>&gt;<\/span><\/span>\r\n<\/pre>\n<h2>Logout (logout.php)<\/h2>\n<p>If the user wishes to log out from their LinkedIn account, the <code>logout.php<\/code> file is loaded.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>Remove OAuth status and user data from the SESSION.<\/li>\n<li>Redirect the user to the homepage.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Start&nbsp;session\r\n<\/span><span style=\"color: #007700\">if(!<\/span><span style=\"color: #0000BB\">session_id<\/span><span style=\"color: #007700\">()){\r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">session_start<\/span><span style=\"color: #007700\">();\r\n}\r\n\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Unset&nbsp;token&nbsp;and&nbsp;user&nbsp;data&nbsp;from&nbsp;session\r\n<\/span><span style=\"color: #007700\">unset(<\/span><span style=\"color: #0000BB\">$_SESSION<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'oauth_status'<\/span><span style=\"color: #007700\">]);\r\nunset(<\/span><span style=\"color: #0000BB\">$_SESSION<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'userData'<\/span><span style=\"color: #007700\">]);\r\n\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Destroy&nbsp;entire&nbsp;session\r\n<\/span><span style=\"color: #0000BB\">session_destroy<\/span><span style=\"color: #007700\">();\r\n\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Redirect&nbsp;to&nbsp;homepage\r\n<\/span><span style=\"color: #0000BB\">header<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"Location:index.php\"<\/span><span style=\"color: #007700\">);\r\nexit;\r\n<\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<p class=\"seeAlso\"><span><\/span><a href=\"https:\/\/www.codexworld.com\/codeigniter-linkedin-login\/\">Login with LinkedIn in CodeIgniter<\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>As per the LinkedIn developer program updates, all the developer needs to migrate APIs to Version 2.0 with OAuth 2.0 by May 1, 2019. If you integrated LinkedIn Login in the web site, your authentication code needs to be updated with LinkedIn API v2 and OAuth 2.0. Our example code helps you to integrate the login system with LinkedIn API v2 using PHP. To make the LinkedIn login more user-friendly, you can use JavaScript SDK to integrate <a href=\"https:\/\/www.codexworld.com\/login-with-linkedin-using-javascript-sdk\/\">LinkedIn Login without page refresh using JavaScript<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LinkedIn is one of the most popular social networks with a huge user base. Like the Facebook, Twitter and Google authentication, LinkedIn also used for the user authentication in the web application. If you want <\/p>\n","protected":false},"author":1,"featured_media":3963,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[250,166,293,84,39,14,133],"class_list":["post-559","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-api","tag-library","tag-linkedin","tag-login","tag-oauth","tag-php","tag-social-login","cat-4-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Login with LinkedIn using PHP - CodexWorld<\/title>\n<meta name=\"description\" content=\"Login with LinkedIn OAuth in PHP - Example script to integrate Sign-In with LinkedIn using PHP. Use LinkedIn API v2 and OAuth 2.0 to integrate login system with PHP and MySQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Login with LinkedIn using PHP - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Login with LinkedIn OAuth in PHP - Example script to integrate Sign-In with LinkedIn using PHP. Use LinkedIn API v2 and OAuth 2.0 to integrate login system with PHP and MySQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2015-04-28T20:24:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-13T06:53:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/login-with-linkedin-api-using-php-oauth-library-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Login with LinkedIn using PHP\",\"datePublished\":\"2015-04-28T20:24:42+00:00\",\"dateModified\":\"2022-11-13T06:53:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/\"},\"wordCount\":957,\"commentCount\":31,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/login-with-linkedin-api-using-php-oauth-library-codexworld.png\",\"keywords\":[\"API\",\"Library\",\"LinkedIn\",\"Login\",\"OAuth\",\"PHP\",\"Social Login\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/\",\"name\":\"Login with LinkedIn using PHP - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/login-with-linkedin-api-using-php-oauth-library-codexworld.png\",\"datePublished\":\"2015-04-28T20:24:42+00:00\",\"dateModified\":\"2022-11-13T06:53:44+00:00\",\"description\":\"Login with LinkedIn OAuth in PHP - Example script to integrate Sign-In with LinkedIn using PHP. Use LinkedIn API v2 and OAuth 2.0 to integrate login system with PHP and MySQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/login-with-linkedin-api-using-php-oauth-library-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/login-with-linkedin-api-using-php-oauth-library-codexworld.png\",\"width\":1366,\"height\":768,\"caption\":\"login-with-linkedin-api-using-php-oauth-library-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/login-with-linkedin-using-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Login with LinkedIn using PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Login with LinkedIn using PHP - CodexWorld","description":"Login with LinkedIn OAuth in PHP - Example script to integrate Sign-In with LinkedIn using PHP. Use LinkedIn API v2 and OAuth 2.0 to integrate login system with PHP and MySQL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/","og_locale":"en_US","og_type":"article","og_title":"Login with LinkedIn using PHP - CodexWorld","og_description":"Login with LinkedIn OAuth in PHP - Example script to integrate Sign-In with LinkedIn using PHP. Use LinkedIn API v2 and OAuth 2.0 to integrate login system with PHP and MySQL.","og_url":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2015-04-28T20:24:42+00:00","article_modified_time":"2022-11-13T06:53:44+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/login-with-linkedin-api-using-php-oauth-library-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Login with LinkedIn using PHP","datePublished":"2015-04-28T20:24:42+00:00","dateModified":"2022-11-13T06:53:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/"},"wordCount":957,"commentCount":31,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/login-with-linkedin-api-using-php-oauth-library-codexworld.png","keywords":["API","Library","LinkedIn","Login","OAuth","PHP","Social Login"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/","url":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/","name":"Login with LinkedIn using PHP - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/login-with-linkedin-api-using-php-oauth-library-codexworld.png","datePublished":"2015-04-28T20:24:42+00:00","dateModified":"2022-11-13T06:53:44+00:00","description":"Login with LinkedIn OAuth in PHP - Example script to integrate Sign-In with LinkedIn using PHP. Use LinkedIn API v2 and OAuth 2.0 to integrate login system with PHP and MySQL.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/login-with-linkedin-api-using-php-oauth-library-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/login-with-linkedin-api-using-php-oauth-library-codexworld.png","width":1366,"height":768,"caption":"login-with-linkedin-api-using-php-oauth-library-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/login-with-linkedin-using-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Login with LinkedIn using PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/04\/login-with-linkedin-api-using-php-oauth-library-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-91","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=559"}],"version-history":[{"count":14,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/559\/revisions"}],"predecessor-version":[{"id":4467,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/559\/revisions\/4467"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/3963"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}