r10518@t0mlaptop (orig r10517): t0m | 2009-06-12 11:27:58 +0100
Tomas Doran [Thu, 9 Sep 2010 22:56:54 +0000 (22:56 +0000)]
 Make error more useful
 r10589@t0mlaptop (orig r10588):  t0m | 2009-06-19 16:14:16 +0100
 Make Credential::Remote have a username_field config option
 r10590@t0mlaptop (orig r10589):  t0m | 2009-06-19 16:16:43 +0100
 Bump versions for release
 r10728@t0mlaptop (orig r10727):  t0m | 2009-06-29 17:55:35 +0100
 Fix issue if you have auth store plugins before authentication plugin
 r10769@t0mlaptop (orig r10768):  t0m | 2009-07-01 17:42:46 +0100
 Checking in changes prior to tagging of version 0.10014.  Changelog diff is:

 Index: Changes
 ===================================================================
 --- Changes (revision 10727)
 +++ Changes (working copy)
 @@ -1,5 +1,6 @@
  Revision history for Perl extension Catalyst::Plugin::Authentication

 +0.10014 Wed Jul  1 17:40:38 BST 2009
        - Make auth_realms method ensure authentication is initialized
          before calling methods which get created during auth initialization.
          Fixes back compat cases where auth store is in the plugin list

 r11234@t0mlaptop (orig r11233):  t0m | 2009-08-24 14:30:51 +0100
 Stop forcing $authinfo->{id} to be passed down to the store, instead using just configurable username_field.
 r11241@t0mlaptop (orig r11240):  t0m | 2009-08-25 15:27:40 +0100
 Change default username_field back to 'username', as this fits in better with the DBIC store / SimpleDB / tutorial / preexisting documentation etc
 r11243@t0mlaptop (orig r11242):  t0m | 2009-08-25 15:45:30 +0100
 Checking in changes prior to tagging of version 0.10014.  Changelog diff is:

 Index: Changes
 ===================================================================
 --- Changes (revision 11232)
 +++ Changes (working copy)
 @@ -1,6 +1,11 @@
  Revision history for Perl extension Catalyst::Plugin::Authentication

 -0.10014 Wed Jul  1 17:40:38 BST 2009
 +0.10014 Tue Aug 25 15:42:57 BST 2009
 +
 +      - Don't always supply an "id" column in the authinfo passed to the store
 +        class in ::Credential::Remote. This means that it works better with
 +        the DBIC store. (t0m)
 +
        - Make auth_realms method ensure authentication is initialized
          before calling methods which get created during auth initialization.
          Fixes back compat cases where auth store is in the plugin list

 r11276@t0mlaptop (orig r11275):  t0m | 2009-09-01 01:49:39 +0100
 Checking in changes prior to tagging of version 0.10015.  Changelog diff is:

 Index: Changes
 ===================================================================
 --- Changes (revision 11261)
 +++ Changes (working copy)
 @@ -1,5 +1,12 @@
  Revision history for Perl extension Catalyst::Plugin::Authentication

 +0.10015 Tue Sep 1 01:40:36 BST 2009
 +
 +     - Remove (undeclared) dependency on Class::Data::Inhertiable (RT#49086)
 +     - Remove dependency on Test::MockObject
 +     - Fix repository metadata in META.yml / Makefile.PL
 +     - Make POD tests author side only.
 +
  0.10014 Tue Aug 25 15:42:57 BST 2009

        - Don't always supply an "id" column in the authinfo passed to the store

 r11368@t0mlaptop (orig r11338):  t0m | 2009-09-08 08:29:46 +0100
 Small doc fixes
 r11559@t0mlaptop (orig r11524):  t0m | 2009-10-14 01:30:11 +0100
 Change example configs to fit in with recent DBIC store
 r11560@t0mlaptop (orig r11525):  t0m | 2009-10-14 01:34:35 +0100
 If this wasn't a patch in RT, I wouldn't be applying it
 r11571@t0mlaptop (orig r11536):  t0m | 2009-10-15 16:09:14 +0100
 Not needed in BEGIN
 r11572@t0mlaptop (orig r11537):  t0m | 2009-10-15 16:09:37 +0100
 Note here
 r11575@t0mlaptop (orig r11540):  t0m | 2009-10-16 01:50:28 +0100
 Add AUTOLOAD nicked from the dbic store to base class
 r11576@t0mlaptop (orig r11541):  t0m | 2009-10-16 02:28:16 +0100
 Epic cleanup and code shuffle in tests to avoid warnings
 r11628@t0mlaptop (orig r11593):  rafl | 2009-10-17 17:40:51 +0100
 Remove debugging code polluting STDERR.
 r11683@t0mlaptop (orig r11648):  jawnsy | 2009-10-21 02:41:14 +0100
 Bring copyright statement in sync with the other packages
 r12472@t0mlaptop (orig r12437):  rafl | 2009-12-19 23:51:32 +0000
 A bit of clarification - logout does not delete the session.

 semifor++
 r12526@t0mlaptop (orig r12491):  xenoterracide | 2009-12-30 12:59:24 +0000
 minor code example fix in documentation
 r12527@t0mlaptop (orig r12492):  t0m | 2009-12-30 13:04:14 +0000
 Fix hard tabs (by converting to 4 space soft tabs), fix trailing whitespace
 r12545@t0mlaptop (orig r12510):  xenoterracide | 2010-01-03 13:26:12 +0000
 Clean up documentation errors
 r12745@t0mlaptop (orig r12710):  stephan48 | 2010-01-22 21:30:20 +0000
 Fixed RT Bug 47106; Code used the wrong Object to Retrieve authinfo_munge
 r12746@t0mlaptop (orig r12711):  rafl | 2010-01-22 21:34:14 +0000
 Some formatting and whitespace tweaks.
 r12747@t0mlaptop (orig r12712):  rafl | 2010-01-22 21:44:55 +0000
 Clean up some more tabs and whitespaces.
 r12748@t0mlaptop (orig r12713):  rafl | 2010-01-22 21:45:01 +0000
 Prepare release.
 r12749@t0mlaptop (orig r12714):  rafl | 2010-01-22 21:50:39 +0000
 Add .gitignore.
 r12750@t0mlaptop (orig r12715):  rafl | 2010-01-22 21:50:43 +0000
 Ignore git files from MANIFEST.
 r12751@t0mlaptop (orig r12716):  rafl | 2010-01-22 21:50:49 +0000
 Port from NEXT to C3.

 Also clean up more silly whitespace.
 r12752@t0mlaptop (orig r12717):  rafl | 2010-01-22 21:50:55 +0000
 Version 0.10016.
 r12754@t0mlaptop (orig r12719):  rafl | 2010-01-22 21:55:20 +0000
 Add a NoTabs test and make it pass.
 r12916@t0mlaptop (orig r12880):  jawnsy | 2010-02-15 23:36:41 +0000
 fix typos Debian picked up
 r13054@t0mlaptop (orig r13018):  t0m | 2010-03-07 20:56:42 +0000
 Date in changes
 r13082@t0mlaptop (orig r13046):  xenoterracide | 2010-03-17 22:52:21 +0000
 Make debug message clear for users of progressive realms
 r13132@t0mlaptop (orig r13096):  rafl | 2010-03-29 14:58:42 +0100
 Fix syntax error.

1  2 
Makefile.PL
lib/Catalyst/Authentication/Credential/Password.pm
lib/Catalyst/Authentication/Realm/Progressive.pm
lib/Catalyst/Authentication/Store/Minimal.pm
lib/Catalyst/Authentication/User.pm
lib/Catalyst/Plugin/Authentication.pm

diff --combined Makefile.PL
@@@ -1,7 -1,9 +1,9 @@@
  use inc::Module::Install 0.87;
  
- if( -e 'MANIFEST.SKIP' ) {
-     system( 'pod2text lib/Catalyst/Plugin/Authentication.pm > README' );
+ if ( $Module::Install::AUTHOR ) {
+     system( 'pod2text lib/Catalyst/Plugin/Authentication.pm > README' )
+         and die;
+     require Module::Install::AuthorTests;
  }
  
  perl_version '5.008001';
  name 'Catalyst-Plugin-Authentication';
  all_from 'lib/Catalyst/Plugin/Authentication.pm';
  
 -requires 'Catalyst::Runtime';
 +requires 'Moose' => '0.78';
 +requires 'namespace::autoclean' => '0.05';
 +requires 'Catalyst::Runtime' => '5.80004';
  requires 'Class::Inspector';
  requires 'MRO::Compat';
  requires 'Catalyst::Plugin::Session' => '0.10';
  
- test_requires 'Test::More';
+ test_requires 'Test::More' => '0.88';
  test_requires 'Test::Exception';
- test_requires 'Test::MockObject';
+ test_requires 'Class::MOP';
+ test_requires 'Moose';
+ author_tests 't/author';
  
  auto_install;
- resources repository => 'http://dev.catalyst.perl.org/repos/Catalyst/trunk/Catalyst-Plugin-Authentication/';
+ resources repository => 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Plugin-Authentication/0.10000/trunk';
  
  WriteAll;
@@@ -1,21 -1,25 +1,22 @@@
  package Catalyst::Authentication::Credential::Password;
 -
 -use strict;
 -use warnings;
 -
 -use base qw/Class::Accessor::Fast/;
 +use Moose;
 +use namespace::autoclean;
  
  use Scalar::Util        ();
  use Catalyst::Exception ();
  use Digest              ();
  
 -__PACKAGE__->mk_accessors(qw/_config realm/);
 +has [qw/_config realm/] => ( is => 'rw' );
  
 -sub new {
 +sub BUILDARGS {
      my ($class, $config, $app, $realm) = @_;
-     
+     # Note _config is horrible back compat hackery!
 -    my $self = { _config => $config };
 -    bless $self, $class;
 -    
 -    $self->realm($realm);
 -    
 +    { realm => $realm, _config => $config };
 +}
 +
 +sub BUILD {
 +    my ($self, $args) = @_;    
      $self->_config->{'password_field'} ||= 'password';
      $self->_config->{'password_type'}  ||= 'clear';
      $self->_config->{'password_hash_type'} ||= 'SHA-1';
@@@ -24,6 -28,7 +25,6 @@@
      if (!grep /$passwordtype/, ('none', 'clear', 'hashed', 'salted_hash', 'crypted', 'self_check')) {
          Catalyst::Exception->throw(__PACKAGE__ . " used with unsupported password type: " . $self->_config->{'password_type'});
      }
 -    return $self;
  }
  
  sub authenticate {
              return $user_obj;
          }
      } else {
-         $c->log->debug("Unable to locate user matching user info provided") if $c->debug;
+         $c->log->debug(
+             'Unable to locate user matching user info provided in realm: '
+             . $realm->name
+             ) if $c->debug;
          return;
      }
  }
@@@ -86,7 -94,7 +90,7 @@@ sub check_password 
      }
  }
  
 -__PACKAGE__;
 +__PACKAGE__->meta->make_immutable;
  
  __END__
  
@@@ -121,7 -129,7 +125,7 @@@ provided against the user retrieved fro
  =head1 CONFIGURATION
  
      # example
-     __PACKAGE__->config->{'Plugin::Authentication'} = 
+     __PACKAGE__->config('Plugin::Authentication' => 
                  {  
                      default_realm => 'members',
                      realms => {
@@@ -1,9 -1,10 +1,9 @@@
  package Catalyst::Authentication::Realm::Progressive;
 -
 +use Moose;
  use Carp;
 -use warnings;
 -use strict;
 +use namespace::autoclean;
  
 -use base 'Catalyst::Authentication::Realm';
 +extends 'Catalyst::Authentication::Realm';
  
  =head1 NAME
  
@@@ -12,8 -13,8 +12,8 @@@ Catalyst::Authentication::Realm::Progre
  =head1 SYNOPSIS
  
  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. 
+ 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
@@@ -40,11 -41,11 +40,11 @@@ the normal realm
                  # Modify the authinfo passed into authenticate by merging
                  # these hashes into the realm's authenticate call:
                  authinfo_munge => {
-                     'local'     => { 'type' => 'normal' },
-                     'temp'      => { 'type' => 'temporary' },
+                     normal => { 'type' => 'normal' },
+                     temp   => { 'type' => 'temporary' },
                  }
              },
-             'normal' => {
+             normal => {
                  credential => {
                      class => 'Password',
                      password_field => 'secret',
@@@ -53,7 -54,7 +53,7 @@@
                  },
                  store => {
                      class      => 'DBIx::Class',
-                     user_class => 'Schema::Person::Identity',
+                     user_model => 'Schema::Person::Identity',
                      id_field   => 'id',
                  }
              },
                  },
                  store => {
                      class    => 'DBIx::Class',
-                     user_class => 'Schema::Person::Identity',
+                     user_model => 'Schema::Person::Identity',
                      id_field   => 'id',
                  }
              },
          }
      }
-  ); 
+  );
  
  Then, in your controller code, to attempt authentication against both realms
  you just have to do a simple authenticate call:
@@@ -89,7 -90,7 +89,7 @@@
  
  =item realms
  
- An array reference consisting of each realm to attempt authentication against, 
+ An array reference consisting of each realm to attempt authentication against,
  in the order listed.  If the realm does not exist, calling authenticate will
  die.
  
@@@ -98,7 -99,7 +98,7 @@@
  A hash reference keyed by realm names, with values being hash references to
  merge into the authinfo call that is subsequently passed into the realm's
  authenticate method.  This is useful if your store uses the same class for each
- realm, separated by some other token (in the L<EXAMPLE> authinfo_mungesection, 
+ realm, separated by some other token (in the L<EXAMPLE> authinfo_mungesection,
  the 'realm' is a column on C<Schema::Person::Identity> that will be either
  'temp' or 'local', to ensure the query to fetch the user finds the right
  Identity record for that realm.
@@@ -127,11 -128,11 +127,11 @@@ sub authenticate 
          unless ref $realms eq 'ARRAY';
      foreach my $realm_name ( @$realms ) {
          my $realm = $c->get_auth_realm( $realm_name );
-         carp "Unable to find realm: $realm_name, check configuration" 
+         carp "Unable to find realm: $realm_name, check configuration"
              unless $realm;
          my $auth = { %$authinfo };
          $auth->{realm} ||= $realm->name;
-         if ( my $info = $realm->config->{authinfo_munge}->{$realm->name} ) {
+         if ( my $info = $self->config->{authinfo_munge}->{$realm->name} ) {
              $auth = Catalyst::Utils::merge_hashes($auth, $info);
          }
          if ( my $obj = $realm->authenticate( $c, $auth ) ) {
      return;
  }
  
- ## we can not rely on inheriting new() because in this case we do not 
- ## load a credential or store, which is what new() sets up in the 
+ ## we can not rely on inheriting new() because in this case we do not
+ ## load a credential or store, which is what new() sets up in the
  ## standard realm.  So we have to create our realm object, set our name
  ## and return $self in order to avoid nasty warnings.
  
 -sub new {
 -    my ($class, $realmname, $config, $app) = @_;
 -
 -    my $self = { config => $config };
 -    bless $self, $class;
 -
 -    $self->name($realmname);
 -    return $self;
 -}
 +sub BUILD { }
  
  =head1 AUTHORS
  
@@@ -1,34 -1,40 +1,34 @@@
  package Catalyst::Authentication::Store::Minimal;
 -
 -use strict;
 -use warnings;
 -
 +use Moose;
  use Catalyst::Authentication::User::Hash;
 -use Scalar::Util qw( blessed );
 -use base qw/Class::Accessor::Fast/;
 +use namespace::autoclean;
  
 -BEGIN {
 -    __PACKAGE__->mk_accessors(qw/userhash/);
 -}
 +has userhash => ( is => 'rw');
  
 -sub new {
 +sub BUILDARGS {
      my ( $class, $config, $app, $realm) = @_;
  
 -    bless { userhash => $config->{'users'} }, $class;
 +    { userhash => $config->{'users'} };
  }
  
  sub from_session {
-       my ( $self, $c, $id ) = @_;
+     my ( $self, $c, $id ) = @_;
  
-       return $id if ref $id;
+     return $id if ref $id;
  
-       $self->find_user( { id => $id } );
+     $self->find_user( { id => $id } );
  }
  
- ## this is not necessarily a good example of what find_user can do, since all we do is   
- ## look up with the id anyway.  find_user can be used to locate a user based on other 
+ ## this is not necessarily a good example of what find_user can do, since all we do is
+ ## look up with the id anyway.  find_user can be used to locate a user based on other
  ## combinations of data.  See C::P::Authentication::Store::DBIx::Class for a better example
  sub find_user {
      my ( $self, $userinfo, $c ) = @_;
  
      my $id = $userinfo->{'id'};
-     
      $id ||= $userinfo->{'username'};
-     
      return unless exists $self->userhash->{$id};
  
      my $user = $self->userhash->{$id};
@@@ -58,7 -64,7 +58,7 @@@ sub user_supports 
  ## Backwards compatibility
  #
  # This is a backwards compatible routine.  get_user is specifically for loading a user by it's unique id
- # find_user is capable of doing the same by simply passing { id => $id }  
+ # find_user is capable of doing the same by simply passing { id => $id }
  # no new code should be written using get_user as it is deprecated.
  sub get_user {
      my ( $self, $id ) = @_;
@@@ -86,8 -92,8 +86,8 @@@ Catalyst::Authentication::Store::Minima
          Authentication
      /;
  
-     __PACKAGE__->config( 'Plugin::Authentication' => 
-                     {  
+     __PACKAGE__->config( 'Plugin::Authentication' =>
+                     {
                          default_realm => 'members',
                          realms => {
                              members => {
                                  },
                                  store => {
                                      class => 'Minimal',
-                                       users = {
-                                           bob => {
-                                               password => "s00p3r",                                       
-                                               editor => 'yes',
-                                               roles => [qw/edit delete/],
-                                           },
-                                           william => {
-                                               password => "s3cr3t",
-                                               roles => [qw/comment/],
-                                           }
-                                       }                       
-                                   }
-                               }
-                       }
+                                     users => {
+                                         bob => {
+                                             password => "s00p3r",
+                                             editor => 'yes',
+                                             roles => [qw/edit delete/],
+                                         },
+                                         william => {
+                                             password => "s3cr3t",
+                                             roles => [qw/comment/],
+                                         }
+                                     }
+                                 }
+                             }
+                         }
                      }
      );
  
-     
  =head1 DESCRIPTION
  
  This authentication store lets you create a very quick and dirty user
@@@ -134,7 -140,7 +134,7 @@@ at runtime
  
  =over 4
  
- =item class 
+ =item class
  
  The classname used for the store. This is part of
  L<Catalyst::Plugin::Authentication> and is the method by which
@@@ -145,8 -151,8 +145,8 @@@ user store. For this module to be used
  =item users
  
  This is a simple hash of users, the keys are the usenames, and the values are
- hashrefs containing a password key/value pair, and optionally, a roles/list 
- of role-names pair. If using roles, you will also need to add the 
+ hashrefs containing a password key/value pair, and optionally, a roles/list
+ of role-names pair. If using roles, you will also need to add the
  Authorization::Roles plugin.
  
  See the SYNOPSIS for an example.
  =head1 METHODS
  
  There are no publicly exported routines in the Minimal store (or indeed in
- most authentication stores)  However, below is a description of the routines 
+ most authentication stores)  However, below is a description of the routines
  required by L<Catalyst::Plugin::Authentication> for all authentication stores.
  
  =head2 new( $config, $app, $realm )
  
- Constructs a new store object, which uses the user element of the supplied config 
+ Constructs a new store object, which uses the user element of the supplied config
  hash ref as it's backing structure.
  
- =head2 find_user( $authinfo, $c ) 
+ =head2 find_user( $authinfo, $c )
  
  Keys the hash by the 'id' or 'username' element in the authinfo hash and returns the user.
  
@@@ -1,9 -1,12 +1,10 @@@
  package Catalyst::Authentication::User;
 -
 -use strict;
 -use warnings;
 -use base qw/Class::Accessor::Fast/;
 +use Moose;
+ use Scalar::Util qw/refaddr/;
 +use namespace::autoclean;
  
  ## auth_realm is the realm this user came from. 
 -__PACKAGE__->mk_accessors(qw/auth_realm store/);
 +has [qw/auth_realm store/] => ( is => 'rw' );
  
  ## THIS IS NOT A COMPLETE CLASS! it is intended to provide base functionality only.  
  ## translation - it won't work if you try to use it directly.
@@@ -41,7 -44,7 +42,7 @@@ sub supports 
  ## you most likely want to write this yourself.
  sub get {
      my ($self, $field) = @_;
-     
      my $object;
      if ($object = $self->get_object and $object->can($field)) {
          return $object->$field();
@@@ -67,15 -70,19 +68,13 @@@ sub obj 
      return $self->get_object(@_);
  }
  
- ## Backwards Compatibility
- ## you probably want auth_realm, in fact.  but this does work for backwards compatibility.
- ## store should be a read-write accessor - so it was moved to mk_accessors
- ##sub store { 
- ##    my ($self) = @_;
- ##    return $self->auth_realm->{store};
- ##}
+ sub AUTOLOAD {
+     my $self = shift;
+     (my $method) = (our $AUTOLOAD =~ /([^:]+)$/);
+     return if $method eq "DESTROY";
  
 -    my $obj = $self->obj;
 -    # Don't bother unless we have a backing object
 -    return if refaddr($obj) eq refaddr($self);
 -
 -    $obj->$method(@_);
 -}
 -
 +__PACKAGE__->meta->make_immutable;
+ __PACKAGE__;
  
  __END__
  
@@@ -92,7 -99,17 +91,17 @@@ Catalyst::Authentication::User - Base c
  
  =head1 DESCRIPTION
  
- This is the base class for authenticated 
+ This is the base class for authentication user objects.
+ THIS IS NOT A COMPLETE CLASS! it is intended to provide base functionality only.
+ It provides the base methods listed below, and any additional methods
+ are proxied onto the user object fetched from the underlieing store.
+ =head1 NOTES TO STORE IMPLEMENTORS
+ Please read the comments in the source code of this class to work out
+ which methods you should override.
  
  =head1 METHODS
  
@@@ -115,12 -132,17 +124,17 @@@ Returns the value for the $field provid
  
  =head2 get_object( )
  
- Returns the underlying object storing the user data.  The return value of this function will vary depending
+ Returns the underlying object storing the user data.  The return value of this
+ method will vary depending
  on the storage module used.
  
  =head2 obj( )
  
  Shorthand for get_object( )
  
+ =head2 AUTOLOAD
+ Delegates any unknown methods onto the user object returned by ->obj
  =cut
  
@@@ -1,14 -1,18 +1,14 @@@
  package Catalyst::Plugin::Authentication;
 -
 -use base qw/Class::Accessor::Fast/;
 -
 -__PACKAGE__->mk_accessors(qw/_user/);
 -
 -use strict;
 -use warnings;
 -
 +use Moose::Role;
  use MRO::Compat;
  use Tie::RefHash;
  use Class::Inspector;
  use Catalyst::Authentication::Realm;
 +use namespace::autoclean;
 +
 +has _user => ( is => 'rw' );
  
- our $VERSION = "0.10012";
+ our $VERSION = "0.10016";
  
  sub set_authenticated {
      my ( $c, $user, $realmname ) = @_;
          $realmname = 'default';
      }
      my $realm = $c->get_auth_realm($realmname);
-     
      if (!$realm) {
          Catalyst::Exception->throw(
                  "set_authenticated called with nonexistant realm: '$realmname'.");
      }
      $user->auth_realm($realm->name);
  
-     $c->persist_user();    
-     
+     $c->persist_user();
      $c->maybe::next::method($user, $realmname);
  }
  
@@@ -49,11 -53,11 +49,11 @@@ sub user 
  # change this to allow specification of a realm - to verify the user is part of that realm
  # in addition to verifying that they exist.
  sub user_exists {
-       my $c = shift;
-       return defined($c->_user) || defined($c->find_realm_for_persisted_user);
+     my $c = shift;
+     return defined($c->_user) || defined($c->find_realm_for_persisted_user);
  }
  
- # works like user_exists - except only returns true if user 
+ # works like user_exists - except only returns true if user
  # exists AND is in the realm requested.
  sub user_in_realm {
      my ($c, $realmname) = @_;
@@@ -74,7 -78,7 +74,7 @@@ sub __old_save_user_in_session 
      my ( $c, $user, $realmname ) = @_;
  
      $c->session->{__user_realm} = $realmname;
-     
      # we want to ask the store for a user prepared for the session.
      # but older modules split this functionality between the user and the
      # store.  We try the store first.  If not, we use the old method.
@@@ -90,26 -94,26 +90,26 @@@ sub persist_user 
      my $c = shift;
  
      if ($c->user_exists) {
-         
-         ## if we have a valid session handler - we store the 
-         ## realm in the session.  If not - we have to hope that 
+         ## if we have a valid session handler - we store the
+         ## realm in the session.  If not - we have to hope that
          ## the realm can recognize its frozen user somehow.
-         if ($c->can('session') && 
-             $c->config->{'Plugin::Authentication'}{'use_session'} && 
+         if ($c->can('session') &&
+             $c->config->{'Plugin::Authentication'}{'use_session'} &&
              $c->session_is_valid) {
-         
-             $c->session->{'__user_realm'} = $c->_user->auth_realm; 
+             $c->session->{'__user_realm'} = $c->_user->auth_realm;
          }
-         
          my $realm = $c->get_auth_realm($c->_user->auth_realm);
-         
          # used to call $realm->save_user_in_session
          $realm->persist_user($c, $c->user);
      }
  }
  
  
- ## this was a short lived method to update user information - 
+ ## this was a short lived method to update user information -
  ## you should use persist_user instead.
  sub update_user_in_session {
      my $c = shift;
@@@ -126,16 -130,16 +126,16 @@@ sub logout 
      if ($realm) {
          $realm->remove_persisted_user($c);
      }
-     
      $c->maybe::next::method(@_);
  }
  
  sub find_user {
      my ( $c, $userinfo, $realmname ) = @_;
-     
      $realmname ||= 'default';
      my $realm = $c->get_auth_realm($realmname);
-     
      if (!$realm) {
          Catalyst::Exception->throw(
                  "find_user called with nonexistant realm: '$realmname'.");
      return $realm->find_user($userinfo, $c);
  }
  
- ## Consider making this a public method. - would make certain things easier when 
+ ## Consider making this a public method. - would make certain things easier when
  ## dealing with things pre-auth restore.
  sub find_realm_for_persisted_user {
      my $c = shift;
-     
      my $realm;
      if ($c->can('session')
          and $c->config->{'Plugin::Authentication'}{'use_session'}
-         and $c->session_is_valid 
+         and $c->session_is_valid
          and exists($c->session->{'__user_realm'})) {
-     
          $realm = $c->auth_realms->{$c->session->{'__user_realm'}};
          if ($realm->user_is_restorable($c)) {
-             return $realm; 
+             return $realm;
          }
      } else {
          ## we have no choice but to ask each realm whether it has a persisted user.
          foreach my $realmname (@{$c->_auth_realm_restore_order}) {
-             my $ret = $c->auth_realms->{$realmname}->user_is_restorable($c);
-             if ($ret) {
-                 return $c->auth_realms->{$realmname};
-             }
+             my $realm = $c->auth_realms->{$realmname}
+                 || Catalyst::Exception->throw("Could not find authentication realm '$realmname'");
+             return $realm
+                 if $realm->user_is_restorable($c);
          }
      }
      return undef;
@@@ -175,29 -179,29 +175,29 @@@ sub auth_restore_user 
  
      my $realm;
      if (defined($realmname)) {
-         $realm = $c->get_auth_realm($realmname); 
+         $realm = $c->get_auth_realm($realmname);
      } else {
          $realm = $c->find_realm_for_persisted_user;
      }
      return undef unless $realm; # FIXME die unless? This is an internal inconsistency
-       
      $c->_user( my $user = $realm->restore_user( $c, $frozen_user ) );
-     
      # this sets the realm the user originated in.
      $user->auth_realm($realm->name) if $user;
-         
      return $user;
  
  }
  
 -# we can't actually do our setup in setup because the model has not yet been loaded.
 -# So we have to trigger off of setup_finished.  :-(
 -sub setup {
 +# We can't actually do our setup in setup because the model has not yet been loaded.  
 +# So we have to trigger before 'setup_finalize'.
 +before 'setup_finalize' => sub {
      my $app = shift;
  
 +    $app->mk_classdata('_auth_initialized');
      $app->_authentication_initialize();
 -    $app->next::method(@_);
 -}
 +};
  
  ## the actual initialization routine. whee.
  sub _authentication_initialize {
      ## let's avoid recreating / configuring everything if we have already done it, eh?
      if ($app->can('_auth_realms')) { return };
  
-     ## make classdata where it is used.  
+     ## make classdata where it is used.
      $app->mk_classdata( '_auth_realms' => {});
-     
-     ## the order to attempt restore in - If we don't have session - we have 
-     ## no way to be sure where a frozen user came from - so we have to 
-     ## ask each realm if it can restore the user.  Unfortunately it is possible 
-     ## that multiple realms could restore the user from the data we have - 
-     ## So we have to determine at setup time what order to ask the realms in.  
+     ## the order to attempt restore in - If we don't have session - we have
+     ## no way to be sure where a frozen user came from - so we have to
+     ## ask each realm if it can restore the user.  Unfortunately it is possible
+     ## that multiple realms could restore the user from the data we have -
+     ## So we have to determine at setup time what order to ask the realms in.
      ## The default is to use the user_restore_priority values defined in the realm
-     ## config. if they are not defined - we go by alphabetical order.   Note that 
+     ## config. if they are not defined - we go by alphabetical order.   Note that
      ## the 'default' realm always gets first chance at it unless it is explicitly
      ## placed elsewhere by user_restore_priority.  Remember this only comes
-     ## into play if session is disabled. 
-     
+     ## into play if session is disabled.
      $app->mk_classdata( '_auth_realm_restore_order' => []);
  
      my $cfg = $app->config->{'Plugin::Authentication'};
-       my $realmshash;
+     my $realmshash;
      if (!defined($cfg)) {
          if (exists($app->config->{'authentication'})) {
              $cfg = $app->config->{'authentication'};
              $cfg = {};
          }
      } else {
-               # the realmshash contains the various configured realms.  By default this is
-               # the main $app->config->{'Plugin::Authentication'} hash - but if that is 
-               # not defined, or there is a subkey {'realms'} then we use that.
-               $realmshash = $cfg;
-       }
-       
-       ## If we have a sub-key of {'realms'} then we use that for realm configuration
-       if (exists($cfg->{'realms'})) {
-               $realmshash = $cfg->{'realms'};
-       }
+         # the realmshash contains the various configured realms.  By default this is
+         # the main $app->config->{'Plugin::Authentication'} hash - but if that is
+         # not defined, or there is a subkey {'realms'} then we use that.
+         $realmshash = $cfg;
+     }
+     ## If we have a sub-key of {'realms'} then we use that for realm configuration
+     if (exists($cfg->{'realms'})) {
+         $realmshash = $cfg->{'realms'};
+     }
  
      # old default was to force use_session on.  This must remain for that
      # reason - but if use_session is already in the config, we respect its setting.
      if (!exists($cfg->{'use_session'})) {
          $cfg->{'use_session'} = 1;
      }
-     
-     ## if we have a realms hash  
+     ## if we have a realms hash
      if (ref($realmshash) eq 'HASH') {
-         
          my %auth_restore_order;
          my $authcount = 2;
          my $defaultrealm = 'default';
-               
          foreach my $realm (sort keys %{$realmshash}) {
              if (ref($realmshash->{$realm}) eq 'HASH' &&
-                               (exists($realmshash->{$realm}{credential}) || exists($realmshash->{$realm}{class}))) {
-                                       
-                   $app->setup_auth_realm($realm, $realmshash->{$realm});
-             
-                   if (exists($realmshash->{$realm}{'user_restore_priority'})) {
-                       $auth_restore_order{$realm} = $realmshash->{$realm}{'user_restore_priority'};
-                   } else {
-                       $auth_restore_order{$realm} = $authcount++;
-                   }
-                       }
+                 (exists($realmshash->{$realm}{credential}) || exists($realmshash->{$realm}{class}))) {
+                 $app->setup_auth_realm($realm, $realmshash->{$realm});
+                 if (exists($realmshash->{$realm}{'user_restore_priority'})) {
+                     $auth_restore_order{$realm} = $realmshash->{$realm}{'user_restore_priority'};
+                 } else {
+                     $auth_restore_order{$realm} = $authcount++;
+                 }
+             }
          }
-         
-         # if we have a 'default_realm' in the config hash and we don't already 
+         # if we have a 'default_realm' in the config hash and we don't already
          # have a realm called 'default', we point default at the realm specified
          if (exists($cfg->{'default_realm'}) && !$app->get_auth_realm('default')) {
              if ($app->_set_default_auth_realm($cfg->{'default_realm'})) {
                  delete($auth_restore_order{$cfg->{'default_realm'}});
              }
          }
-         
          ## if the default realm did not have a defined priority in its config - we put it at the front.
          if (!exists($realmshash->{$defaultrealm}{'user_restore_priority'})) {
              $auth_restore_order{'default'} = 1;
          }
-         
          @{$app->_auth_realm_restore_order} = sort { $auth_restore_order{$a} <=> $auth_restore_order{$b} } keys %auth_restore_order;
-         
      } else {
-         
          ## BACKWARDS COMPATIBILITY - if realms is not defined - then we are probably dealing
          ## with an old-school config.  The only caveat here is that we must add a classname
-         
-         ## also - we have to treat {store} as {stores}{default} - because 
-         ## while it is not a clear as a valid config in the docs, it 
+         ## also - we have to treat {store} as {stores}{default} - because
+         ## while it is not a clear as a valid config in the docs, it
          ## is functional with the old api. Whee!
          if (exists($cfg->{'store'}) && !exists($cfg->{'stores'}{'default'})) {
              $cfg->{'stores'}{'default'} = $cfg->{'store'};
              my $realmcfg = {
                  store => { class => $cfg->{'stores'}{$storename} },
              };
-             print STDERR "Foo, ok?\n";
              $app->setup_auth_realm($storename, $realmcfg);
          }
-     } 
-     
+     }
  }
  
  # set up realmname.
  sub setup_auth_realm {
      my ($app, $realmname, $config) = @_;
-     
      my $realmclass = $config->{class};
  
      if( !$realmclass ) {
  
  sub auth_realms {
      my $self = shift;
+     $self->_authentication_initialize(); # Ensure _auth_realms created!
      return($self->_auth_realms);
  }
  
  sub get_auth_realm {
      my ($app, $realmname) = @_;
-     
      return $app->auth_realms->{$realmname};
-     
  }
  
  
  # Very internal method.  Vital Valuable Urgent, Do not touch on pain of death.
  # Using this method just assigns the default realm to be the value associated
  # with the realmname provided.  It WILL overwrite any real realm called 'default'
- # so can be very confusing if used improperly.  It's used properly already. 
+ # so can be very confusing if used improperly.  It's used properly already.
  # Translation: don't use it.
  sub _set_default_auth_realm {
      my ($app, $realmname) = @_;
-     
      if (exists($app->auth_realms->{$realmname})) {
          $app->auth_realms->{'default'} = $app->auth_realms->{$realmname};
      }
  
  sub authenticate {
      my ($app, $userinfo, $realmname) = @_;
-     
      if (!$realmname) {
          $realmname = 'default';
      }
-         
      my $realm = $app->get_auth_realm($realmname);
-     
      ## note to self - make authenticate throw an exception if realm is invalid.
-     
      if ($realm) {
          return $realm->authenticate($app, $userinfo);
      } else {
  ## BACKWARDS COMPATIBILITY  -- Warning:  Here be monsters!
  #
  # What follows are backwards compatibility routines - for use with Stores and Credentials
- # that have not been updated to work with C::P::Authentication v0.10.  
+ # that have not been updated to work with C::P::Authentication v0.10.
  # These are here so as to not break people's existing installations, but will go away
  # in a future version.
  #
  # The old style of configuration only supports a single store, as each store module
- # sets itself as the default store upon being loaded.  This is the only supported 
- # 'compatibility' mode.  
+ # sets itself as the default store upon being loaded.  This is the only supported
+ # 'compatibility' mode.
  #
  
  sub get_user {
@@@ -417,16 -419,16 +415,16 @@@ sub default_auth_store 
      }
      if ( my $new = shift ) {
          $realm->store($new);
-         
          my $storeclass;
          if (ref($new)) {
              $storeclass = ref($new);
          } else {
              $storeclass = $new;
          }
-         
-         # BACKWARDS COMPATIBILITY - if the store class does not define find_user, we define it in terms 
-         # of get_user and add it to the class.  this is because the auth routines use find_user, 
+         # BACKWARDS COMPATIBILITY - if the store class does not define find_user, we define it in terms
+         # of get_user and add it to the class.  this is because the auth routines use find_user,
          # and rely on it being present. (this avoids per-call checks)
          if (!$storeclass->can('find_user')) {
              no strict 'refs';
@@@ -452,9 -454,9 +450,9 @@@ sub auth_store_names 
  
  sub get_auth_store {
      my ( $self, $name ) = @_;
-     
      if ($name ne 'default') {
-         Carp::croak "get_auth_store called on non-default realm '$name'. Only default supported in compatibility mode";        
+         Carp::croak "get_auth_store called on non-default realm '$name'. Only default supported in compatibility mode";
      } else {
          $self->default_auth_store();
      }
@@@ -490,7 -492,7 +488,7 @@@ authentication framework
      /;
  
      # later on ...
-     $c->authenticate({ username => 'myusername', 
+     $c->authenticate({ username => 'myusername',
                         password => 'mypassword' });
      my $age = $c->user->get('age');
      $c->logout;
@@@ -509,10 -511,10 +507,10 @@@ given data from the frontend. A Credent
  'Realm'. A Catalyst application using the authentication framework must have
  at least one realm, and may have several.
  
- To implement authentication in a Catalyst application you need to add this 
- module, and specify at least one realm in the configuration. 
+ To implement authentication in a Catalyst application you need to add this
+ module, and specify at least one realm in the configuration.
  
- Authentication data can also be stored in a session, if the application 
+ Authentication data can also be stored in a session, if the application
  is using the L<Catalyst::Plugin::Session> module.
  
  B<NOTE> in version 0.10 of this module, the interface to this module changed.
@@@ -540,7 -542,7 +538,7 @@@ B<credential verification>
  
  By this time you know exactly who the user is - the user's identity is
  B<authenticated>. This is where this module's job stops, and your application
- or other plugins step in.  
+ or other plugins step in.
  
  The next logical step is B<authorization>, the process of deciding what a user
  is (or isn't) allowed to do. For example, say your users are split into two
@@@ -548,7 -550,7 +546,7 @@@ main groups - regular users and adminis
  currently logged in user is indeed an administrator before performing the
  actions in an administrative part of your application. These decisions may be
  made within your application code using just the information available after
- authentication, or it may be facilitated by a number of plugins.  
+ authentication, or it may be facilitated by a number of plugins.
  
  =head2 The Components In This Framework
  
@@@ -622,8 -624,8 +620,8 @@@ This means that our application will be
          Authentication
      /;
  
-     __PACKAGE__->config( 'Plugin::Authentication' => 
-                 {  
+     __PACKAGE__->config( 'Plugin::Authentication' =>
+                 {
                      default => {
                          credential => {
                              class => 'Password',
                          },
                          store => {
                              class => 'Minimal',
-                               users => {
-                                   bob => {
-                                       password => "s00p3r",                                       
-                                       editor => 'yes',
-                                       roles => [qw/edit delete/],
-                                   },
-                                   william => {
-                                       password => "s3cr3t",
-                                       roles => [qw/comment/],
-                                   }
-                               }                       
-                           }
-                       }
+                             users => {
+                                 bob => {
+                                     password => "s00p3r",
+                                     editor => 'yes',
+                                     roles => [qw/edit delete/],
+                                 },
+                                 william => {
+                                     password => "s3cr3t",
+                                     roles => [qw/comment/],
+                                 }
+                             }
+                         }
+                     }
                  }
      );
  
@@@ -662,7 -664,7 +660,7 @@@ To show an example of this, let's creat
          if (    my $user     = $c->req->params->{user}
              and my $password = $c->req->params->{password} )
          {
-             if ( $c->authenticate( { username => $user, 
+             if ( $c->authenticate( { username => $user,
                                       password => $password } ) ) {
                  $c->res->body( "hello " . $c->user->get("name") );
              } else {
      }
  
  This code should be self-explanatory. If all the necessary fields are supplied,
- call the C<authenticate> method on the context object. If it succeeds the 
+ call the C<authenticate> method on the context object. If it succeeds the
  user is logged in.
  
  The credential verifier will attempt to retrieve the user whose
@@@ -689,13 -691,13 +687,13 @@@ check an alternate realm. If this were 
  authenticate on the admin realm by simply changing the C<< $c->authenticate() >>
  call:
  
-     if ( $c->authenticate( { username => $user, 
+     if ( $c->authenticate( { username => $user,
                               password => $password }, 'admin' ) ) {
          $c->res->body( "hello " . $c->user->get("name") );
      } ...
  
  
- Now suppose we want to restrict the ability to edit to a user with an 
+ Now suppose we want to restrict the ability to edit to a user with an
  'editor' value of yes.
  
  The restricted action might look like this:
@@@ -716,7 -718,7 +714,7 @@@ C<< $c->user_exists(); >> This will ess
  verification as user_exists, with the added requirement that if there
  is a user, it must have come from the realm specified.)
  
- The above example is somewhat similar to role based access control.  
+ The above example is somewhat similar to role based access control.
  L<Catalyst::Authentication::Store::Minimal> treats the roles field as
  an array of role names. Let's leverage this. Add the role authorization
  plugin:
@@@ -742,8 -744,8 +740,8 @@@ efficient to maintain a hash of users, 
  You can accomplish this simply by installing the L<DBIx::Class|Catalyst::Authentication::Store::DBIx::Class> Store and
  changing your config:
  
-     __PACKAGE__->config( 'Plugin::Authentication'} => 
-                     {  
+     __PACKAGE__->config( 'Plugin::Authentication' =>
+                     {
                          default_realm => 'members',
                          members => {
                              credential => {
                              },
                              store => {
                                  class => 'DBIx::Class',
-                                   user_class => 'MyApp::Users',
-                                   role_column => 'roles'                      
-                               }
-                       }
+                                 user_model => 'MyApp::Users',
+                                 role_column => 'roles',
+                             }
+                         }
                      }
      );
  
@@@ -767,8 -769,8 +765,8 @@@ new source. The rest of your applicatio
  =head1 CONFIGURATION
  
      # example
-     __PACKAGE__->config( 'Plugin::Authentication' => 
-                 {  
+     __PACKAGE__->config( 'Plugin::Authentication' =>
+                 {
                      default_realm => 'members',
  
                      members => {
                          },
                          store => {
                              class => 'DBIx::Class',
-                           user_class => 'MyApp::Users',
-                           role_column => 'roles'                      
-                       }
-                       },
-                       admins => {
-                           credential => {
-                               class => 'Password',
-                               password_field => 'password',
+                             user_model => 'MyApp::Users',
+                             role_column => 'roles',
+                         }
+                     },
+                     admins => {
+                         credential => {
+                             class => 'Password',
+                             password_field => 'password',
                              password_type => 'clear'
-                           },
-                           store => {
-                               class => '+MyApp::Authentication::Store::NetAuth',
-                               authserver => '192.168.10.17'
-                           }
-                       }
+                         },
+                         store => {
+                             class => '+MyApp::Authentication::Store::NetAuth',
+                             authserver => '192.168.10.17'
+                         }
+                     }
                  }
      );
  
  NOTE: Until version 0.10008 of this module, you would need to put all the
- realms inside a "realms" key in the configuration. Please see 
+ realms inside a "realms" key in the configuration. Please see
  L</COMPATIBILITY CONFIGURATION> for more information
  
  =over 4
@@@ -822,23 -824,23 +820,23 @@@ that require a realm such as authentica
  
  =item realm refs
  
- The Plugin::Authentication config hash contains the series of realm 
- configurations you want to use for your app. The only rule here is 
- that there must be at least one. A realm consists of a name, which is used 
- to reference the realm, a credential and a store.  You may also put your 
- realm configurations within a subelement called 'realms' if you desire to 
+ The Plugin::Authentication config hash contains the series of realm
+ configurations you want to use for your app. The only rule here is
+ that there must be at least one. A realm consists of a name, which is used
+ to reference the realm, a credential and a store.  You may also put your
+ realm configurations within a subelement called 'realms' if you desire to
  separate them from the remainder of your configuration.  Note that if you use
- a 'realms' subelement, you must put ALL of your realms within it.   
+ a 'realms' subelement, you must put ALL of your realms within it.
  
  You can also specify a realm class to instantiate instead of the default
  L<Catalyst::Authentication::Realm> class using the 'class' element within the
  realm config.
  
- Each realm config contains two hashes, one called 'credential' and one called 
+ Each realm config contains two hashes, one called 'credential' and one called
  'store', each of which provide configuration details to the respective modules.
- The contents of these hashes is specific to the module being used, with the 
+ The contents of these hashes is specific to the module being used, with the
  exception of the 'class' element, which tells the core Authentication module the
- classname to instantiate.  
+ classname to instantiate.
  
  The 'class' element follows the standard Catalyst mechanism of class
  specification. If a class is prefixed with a +, it is assumed to be a complete
@@@ -872,25 -874,26 +870,26 @@@ can be much more efficient
  
  =head2 $c->user_in_realm( $realm )
  
- Works like user_exists, except that it only returns true if a user is both 
- logged in right now and was retrieved from the realm provided.  
+ Works like user_exists, except that it only returns true if a user is both
+ logged in right now and was retrieved from the realm provided.
  
  =head2 $c->logout( )
  
- Logs the user out. Deletes the currently logged in user from C<< $c->user >> and the session.
+ Logs the user out. Deletes the currently logged in user from C<< $c->user >>
+ and the session.  It does not delete the session.
  
  =head2 $c->find_user( $userinfo, $realm )
  
- Fetch a particular users details, matching the provided user info, from the realm 
+ Fetch a particular users details, matching the provided user info, from the realm
  specified in $realm.
  
  =head2 persist_user()
  
  Under normal circumstances the user data is only saved to the session during
- initial authentication.  This call causes the auth system to save the 
+ initial authentication.  This call causes the auth system to save the
  currently authenticated user's data across requests.  Useful if you have
  changed the user data and want to ensure that future requests reflect the
- most current data.  Assumes that at the time of this call, $c->user 
+ most current data.  Assumes that at the time of this call, $c->user
  contains the most current data.
  
  =head2 find_realm_for_persisted_user()
@@@ -939,7 -942,7 +938,7 @@@ This was a short-lived method to updat
  =head1 SEE ALSO
  
  This list might not be up to date.  Below are modules known to work with the updated
- API of 0.10 and are therefore compatible with realms.  
+ API of 0.10 and are therefore compatible with realms.
  
  =head2 Realms
  
@@@ -1009,11 -1012,11 +1008,11 @@@ L<Catalyst::Plugin::Authentication::CDB
  
  =head1 INCOMPATABILITIES
  
- The realms-based configuration and functionality of the 0.10 update 
+ The realms-based configuration and functionality of the 0.10 update
  of L<Catalyst::Plugin::Authentication> required a change in the API used by
  credentials and stores.  It has a compatibility mode which allows use of
  modules that have not yet been updated. This, however, completely mimics the
- older api and disables the new realm-based features. In other words you cannot 
+ older api and disables the new realm-based features. In other words you cannot
  mix the older credential and store modules with realms, or realm-based
  configs. The changes required to update modules are relatively minor and are
  covered in L<Catalyst::Plugin::Authentication::Internals>.  We hope that most
@@@ -1022,11 -1025,11 +1021,11 @@@ modules will move to the compatible lis
  =head1 COMPATIBILITY CONFIGURATION
  
  Until version 0.10008 of this module, you needed to put all the
- realms inside a "realms" key in the configuration. 
+ realms inside a "realms" key in the configuration.
  
      # example
-     __PACKAGE__->config( 'Plugin::Authentication'} => 
-                 {  
+     __PACKAGE__->config( 'Plugin::Authentication' =>
+                 {
                      default_realm => 'members',
                      realms => {
                          members => {
@@@ -1043,7 -1046,7 +1042,7 @@@ configuration key, then the realms key 
  
  In version 0.10 of L<Catalyst::Plugin::Authentication>, the API
  changed. For app developers, this change is fairly minor, but for
- Credential and Store authors, the changes are significant. 
+ Credential and Store authors, the changes are significant.
  
  Please see the documentation in version 0.09 of
  Catalyst::Plugin::Authentication for a better understanding of how the old API
@@@ -1052,7 -1055,7 +1051,7 @@@ functioned
  The items below are still present in the plugin, though using them is
  deprecated. They remain only as a transition tool, for those sites which can
  not yet be upgraded to use the new system due to local customizations or use
- of Credential / Store modules that have not yet been updated to work with the 
+ of Credential / Store modules that have not yet been updated to work with the
  new API.
  
  These routines should not be used in any application using realms
@@@ -1074,7 -1077,7 +1073,7 @@@ This is set to C<< $c->config( 'Plugin:
  or by using a Store plugin:
  
      # load the Minimal authentication store.
-       use Catalyst qw/Authentication Authentication::Store::Minimal/;
+     use Catalyst qw/Authentication Authentication::Store::Minimal/;
  
  Sets the default store to
  L<Catalyst::Plugin::Authentication::Store::Minimal>.
@@@ -1109,13 -1112,24 +1108,24 @@@ Jess Robinso
  
  David Kamholz
  
- Tomas Doran (t0m), C<bobtfish@bobtfish.net> 
+ Tomas Doran (t0m), C<bobtfish@bobtfish.net>
+ kmx
+ Nigel Metheringham
+ Florian Ragwitz C<rafl@debian.org>
+ Stephan Jauernick C<stephanj@cpan.org>
  
  =head1 COPYRIGHT & LICENSE
  
-         Copyright (c) 2005 the aforementioned authors. All rights
-         reserved. This program is free software; you can redistribute
-         it and/or modify it under the same terms as Perl itself.
+ Copyright (c) 2005 - 2009
+ the Catalyst::Plugin::Authentication L</AUTHORS>
+ as listed above.
+ This program is free software; you can redistribute
+ it and/or modify it under the same terms as Perl itself.
  
  =cut