Using OpenID for logins
If we don't want to store our users' passwords in our application, there are other authentication methods that use third parties, such as OAuth and OpenID. In this recipe, we'll use OpenID to log in our users.
Getting ready
For this recipe, we need to have a standard installation of Laravel and complete the Setting up OAuth with the HybridAuth package recipe.
How to do it...
To complete this recipe, follow these steps:
In our
app/config
directory, create a new file named asopenid_auth.php
:<?php return array( "base_url" => "http://path/to/our/app/openid/auth", "providers" => array ( "OpenID" => array ("enabled" => TRUE) ) );
In our
routes.php
file, create a route to hold our login form:Route::get('login', function() { return View::make('login'); });
In our
app/views
directory, create a new view named aslogin.php
:<!DOCTYPE html> <html> <head> <title>Laravel Open ID Login</title> ...