Logging in using LinkedIn
If we don't want to worry about storing user's information and credentials, we could use OAuth to authenticate with another service. A popular service to use for logins, especially for business applications, is LinkedIn. With Laravel and the HybridAuth
library, we can easily implement OAuth authentication with LinkedIn.
Getting ready
For this recipe, we need to have the HybridAuth package installed and set up as in the Setting up OAuth with the HybridAuth package recipe.
How to do it...
To complete this recipe, follow these steps:
Create a new app at https://www.linkedin.com/secure/developer.
Get the API Key and the Secret Key, and in the
app/config
directory, create a file namedli_auth.php
:<?php return array( "base_url" => "http://path/to/our/app/liauth/auth", "providers" => array ( "LinkedIn" => array ( "enabled" => true, "keys" => array ("key" => "API_KEY","secret" => "SECRET_KEY") ) ...