The Multi Authentication Library can innately sign into the following services:

Google,

Yahoo,

Facebook

Any OpenID URL.

The source code is available over at the [http://bazaar.launchpad.net/~theodore-phpexperts/phpu-training/trunk/files/head:/2.multiauth/ ”’PHPU-Training Project”’].

= Usage =

For the end-developer, all one has to do to use this library is as follows:

<?php // Join #learnphp on irc.freenode.net for daily PHP lessons and screencasts.

$isLoggedIn = null;

$service = null; if (isset($_POST[‘service’])) { $service = $_POST[‘service’]; }

$ticketMan = new UserAuthenticator($service);

// 1. Attempt to log in the user. try { $ticketMan->attemptToLogin(); } catch (Exception $e) { $errorMessage = $e->getMessage(); }

$isLoggedIn = $ticketMan->isUserAuthenticated(); $loginStatus = ($isLoggedIn == true ? ‘is’ : ‘is not’);

= Project Plan = === v0.1 ===

Added a simple OpenID login system. Theodore R. Smith

=== v0.2: Added an OpenID driver ===

Added an Added OpenID driver.

=== v0.3: Added a Multiple Authentication system ===

Added the beginings of a Multiple Authentication system.

Added an AuthServiceLocator helper class.

Refactored MultiAuth::login() to use the new AuthServiceLocator.

Lots of fixes, plus added in Yahoo support.

Added license boilerplate.

=== v0.4: Added secure sessions and other fixes ===

Added CSRF and session hijacking prevention.

Committed some small fixes.

Added a CHANGELOG.txt

=== v0.5: Added a Facebook authentication system ===

Added the Facebook SDK.

Added a simple Facebook Connect login system.

Added sample fb config file.

=== v0.6: FIXED 5 serious defects ===

FIXED: System never knew when a user was attempting to log in.

FIXED: Session would automatically log out on proper validation.

FIXED: Session was automatically destroyed before validation could be done.

FIXED: Now properly searches the SESSION authkeys array for the POST key.

FIXED: Reimplemented validateSession(); renamed to secureSession().

=== v0.7: Spruce up ===

Add in sticky user session support: eLOE: 15 min LOE: 15 min

Attempt to simplify the library’s end-dev usage: eLOE: 20 min LOE: 2.17 hr

=== v0.8: Added in support for any OpenID URL ===

Create a system for passing custom service parameters. eLOE 35 min LOE: 40 min

Add authentication support for any OpenID URL: eLOE: 5 min LOE: 5 min

=== v0.9: Make release ready ===

Add Thrive_Autoloader: eLOE: 15 min LOE: 10 min

REVERSION: Readd the lost custom OpenID auth eLOE: 10 min LOE: 5 min

Remove all unnecessary includes: eLOE: 8 min LOE: -5 min [done in Iteration 5]

Fix the license boilerplate: eLOE: 10 em LOE: 7 min

Split up Multi Auth files: eLOE: 20 min LOE: 50 min

Add PHPDOC blocks on every public function: eLOE: 10 min LOE: 18 min

=== v1.0: Incorporate into Thrive ===

Remove excessive commentary: eLOE 10 min

Convert to Thrive classes: eLOE: 40 min

Create a Packaging system: eLOE: 15 min

Create and release a distribution: eLOE: 5 min

Publicize

* Create Packaging system: eLOE 15 min

* Remove excessive commentary: eLOE 10 min

Make sure to throw smart error when config file is not present: 8 min

[[Category:PHP_From_Beginner_to_Pro]] s