Setting up OAuth with the HybridAuth package
There may be times when we don't want to worry about storing users' passwords. In that case, OAuth has become a popular alternative that allows us to authenticate a user based on a third-party service such as Facebook or Twitter. This recipe will show how to set up the HybridAuth
package to make OAuth easy.
Getting ready
For this recipe, we need a standard Laravel installation and a way to access the command-line interface, so we can use the Artisan command-line utility.
How to do it...
To complete this recipe, follow these steps:
Open our app's
composer.json
file and add HybridAuth to therequire
section, so it should look like this:"require": { "laravel/framework": "4.0.*", "hybridauth/hybridauth": "dev-master" },
In the command-line interface, update composer as follows:
php composer.phar update
In the
app/config
directory, create a new file named asoauth.php
:<?php return array( "base_url" => "http://path/to/our/app/oauth/auth...