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'
=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
# 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' => {
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
}
}