Logging in using Facebook credentials
If we don't want to worry about storing a user's information and credentials, we could use OAuth to authenticate with another service. One of the most popular is using Facebook for logins. With Laravel and the HybridAuth library, we can easily implement OAuth authentication with Facebook.
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://developers.facebook.com.
Get the App ID and App Secret keys, and in the
app/config
directory, create a file named asfb_auth.php
:<?php return array( "base_url" => "http://path/to/our/app/fbauth/auth", "providers" => array ( "Facebook" => array ( "enabled" => TRUE, "keys" => array ("id" => "APP_ID", "secret" =>"APP_SECRET"), "scope" => "email" ) ...