adding progressive realm. planning for launch
Jay Kuri [Thu, 27 Nov 2008 23:49:56 +0000 (23:49 +0000)]
Changes
lib/Catalyst/Authentication/Realm/Progressive.pm
lib/Catalyst/Plugin/Authentication.pm

diff --git a/Changes b/Changes
index ab6bb59..96ec29e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,10 @@
 Revision history for Perl extension Catalyst::Plugin::Authentication
 
-0.10007 2008-10-23
+0.10009 2008-11-27
+        - Including progressive realm for multiple authentication attempts
+          in a single request.
+
+0.10008 2008-10-23
                - Updating config to allow for inclusion of realm ref's in the main
                  config hash rather than in a subref called 'realms'
 
index 122dcbc..4390f45 100644 (file)
@@ -12,13 +12,18 @@ Catalyst::Authentication::Realm::Progressive - Authenticate against multiple rea
 
 =head1 SYNOPSIS
 
-This Realm allows an application to be built so that multiple realms are 
-supported and tried incrementally until a successful authentication.
+This Realm allows an application to use a single authenticate() call during
+which multiple realms are used and tried incrementally until one performs 
+a successful authentication is accomplished. 
 
-A simple use case is a Temporary Password that looks and acts exactly as a 
-regular password.  Without changing the authentication code, you can 
+A simple use case is a Temporary Password that looks and acts exactly as a
+regular password. Without changing the authentication code, you can
 authenticate against multiple realms.
 
+Another use might be to support a legacy website authentication system, trying
+the current auth system first, and upon failure, attempting authentication against
+the legacy system.
+
 =head2 EXAMPLE
 
 If your application has multiple realms to authenticate, such as a temporary
@@ -36,8 +41,8 @@ the normal realm.
                 # Modify the authinfo passed into authenticate by merging
                 # these hashes into the realm's authenticate call:
                 authinfo_munge => {
-                    'local'     => { 'realm' => 'normal' },
-                    'temp'      => { 'realm' => 'temp' },
+                    'local'     => { 'type' => 'normal' },
+                    'temp'      => { 'type' => 'temporary' },
                 }
             },
             'normal' => {
@@ -74,7 +79,7 @@ Then, in your controller code, to attempt authentication against both realms
 you just have to do a simple authenticate call:
 
  if ( $c->authenticate({ id => $username, password => $password }) ) {
-     if ( $c->user->realm eq 'temp' ) {
+     if ( $c->user->type eq 'temporary' ) {
          # Force user to change password
      }
  }
index 0774362..49ca595 100644 (file)
@@ -13,7 +13,7 @@ use Tie::RefHash;
 use Class::Inspector;
 use Catalyst::Authentication::Realm;
 
-our $VERSION = "0.10008";
+our $VERSION = "0.10009";
 
 sub set_authenticated {
     my ( $c, $user, $realmname ) = @_;