Documentation improvments
Jess Robinson [Tue, 29 Nov 2005 21:47:25 +0000 (21:47 +0000)]
lib/Catalyst/Plugin/Authentication/Credential/Password.pm

index 6a185e1..fd2abc3 100644 (file)
@@ -104,13 +104,14 @@ with a password.
     sub login : Local {\r
         my ( $self, $c ) = @_;\r
 \r
-        $c->login( $c->req->param('login'), $c->req->param('password') );\r
+        $c->login( $c->req->param('username'), $c->req->param('password') );\r
     }\r
 \r
 =head1 DESCRIPTION\r
 \r
-This authentication credential checker takes a user and a password, and tries\r
-various methods of comparing a password based on what the user supports:\r
+This authentication credential checker takes a username (or userid) and a 
+password, and tries various methods of comparing a password based on what 
+the chosen store's user objects support:\r
 \r
 =over 4\r
 \r
@@ -134,30 +135,42 @@ with L<Digest>.
 \r
 =over 4\r
 \r
-=item login $user, $password\r
-\r
-=item login\r
+=item login $username, $password\r
 \r
 Try to log a user in.\r
 \r
-C<$user> can be an ID or object. If it isa\r
-L<Catalyst::Plugin::Authentication::User> it will be used as is. Otherwise\r
-C<< $c->get_user >> is used to retrieve it.\r
+C<$username> can be an ID or string (e.g. retrieved from a form) or an object. 
+If the object is a L<Catalyst::Plugin::Authentication::User> it will be used 
+as is. Otherwise C<< $c->get_user >> is used to retrieve it.\r
 \r
 C<$password> is a string.\r
 \r
-If C<$user> or C<$password> are not provided the parameters C<login>, C<user>,\r
-C<username> and C<password>, C<passwd>, C<pass> will be tried instead.\r
-\r
-=back\r
-\r
+If C<$username> or C<$password> are not provided the query parameters 
+C<login>, C<user>, C<username> and C<password>, C<passwd>, C<pass> will 
+be tried instead.
+
+=back
+
+=head1 RELATED USAGE
+
+After the user is logged in, the user object for the current logged in user 
+can be retrieved from the context using the C<< $c->user >> method.
+
+The current user can be logged out again by calling the C<< $c->logout >> 
+method.
+
 =head1 SUPPORTING THIS PLUGIN\r
-\r
+
+For a User class to support credential verification using this plugin, it
+needs to indicate what sort of password a given user supports 
+by implementing the C<supported_features> method in one or many of the 
+following ways:
+
 =head2 Clear Text Passwords\r
 \r
 Predicate:\r
 \r
-       $user->supports(qw/password clear/);\r
+       $user->supported_features(qw/password clear/);\r
 \r
 Expected methods:\r
 \r
@@ -173,7 +186,7 @@ Returns the user's clear text password as a string to be compared with C<eq>.
 \r
 Predicate:\r
 \r
-       $user->supports(qw/password crypted/);\r
+       $user->supported_features(qw/password crypted/);\r
 \r
 Expected methods:\r
 \r
@@ -189,7 +202,7 @@ Return's the user's crypted password as a string, with the salt as the first two
 \r
 Predicate:\r
 \r
-       $user->supports(qw/password hashed/);\r
+       $user->supported_features(qw/password hashed/);\r
 \r
 Expected methods:\r
 \r
@@ -216,7 +229,7 @@ a pre-salt is used.
 \r
 Predicate:\r
 \r
-       $user->supports(qw/password salted_hash/);\r
+       $user->supported_features(qw/password salted_hash/);\r
 \r
 Expected methods:\r
 \r
@@ -224,7 +237,7 @@ Expected methods:
 \r
 =item hashed_password\r
 \r
-Return's the hash of the user's password as returned from L<Crypt-SaltedHash>->generate.\r
+Returns the hash of the user's password as returned from L<Crypt-SaltedHash>->generate.\r
 \r
 =back\r
 \r