You can checkout the source code for this example from the catalyst
subversion repository as per the instructions in
-L<Catalyst::Manual::Tutorial::01_Intro|Catalyst::Manual::Tutorial::01_Intro>.
+L<Catalyst::Manual::Tutorial::01_Intro>.
=head1 BASIC AUTHENTICATION
C<many_to_many> relationship information to the User Result Source file.
As with the Book, BookAuthor, and Author files in
L<Chapter 3|Catalyst::Manual::Tutorial::03_MoreCatalystBasics>,
-L<DBIx::Class::Schema::Loader|DBIx::Class::Schema::Loader> has
+L<DBIx::Class::Schema::Loader> has
automatically created the C<has_many> and C<belongs_to> relationships
for the new User, UserRole, and Role tables. However, as a convenience
for mapping Users to their assigned roles (see
=head2 Configure Authentication
There are a variety of ways to provide configuration information to
-L<Catalyst::Plugin::Authentication|Catalyst::Plugin::Authentication>.
+L<Catalyst::Plugin::Authentication>.
Here we will use
-L<Catalyst::Authentication::Realm::SimpleDB|Catalyst::Authentication::Realm::SimpleDB>
+L<Catalyst::Authentication::Realm::SimpleDB>
because it automatically sets a reasonable set of defaults for us. Open
C<lib/MyApp.pm> and place the following text above the call to
C<__PACKAGE__-E<gt>setup();>:
# Configure SimpleDB Authentication
- __PACKAGE__->config->{'Plugin::Authentication'} = {
+ __PACKAGE__->config(
+ 'Plugin::Authentication' => {
default => {
class => 'SimpleDB',
user_model => 'DB::User',
password_type => 'clear',
},
- };
+ },
+ );
We could have placed this configuration in C<myapp.conf>, but placing
it in C<lib/MyApp.pm> is probably a better place since it's not likely
</Plugin::Authentication>
B<TIP:> Here is a short script that will dump the contents of
-C<MyApp->config> to L<Config::General|Config::General> format in
+C<MyApp->config> to L<Config::General> format in
C<myapp.conf>:
$ CATALYST_DEBUG=0 perl -Ilib -e 'use MyApp; use Config::General;
only change is to the C<password_type> field):
# Configure SimpleDB Authentication
- __PACKAGE__->config->{'Plugin::Authentication'} = {
+ __PACKAGE__->config(
+ 'Plugin::Authentication' => {
default => {
class => 'SimpleDB',
user_model => 'DB::User',
password_type => 'self_check',
},
- };
+ },
+ );
The use of C<self_check> will cause
Catalyst::Plugin::Authentication::Store::DBIC to call the
exactly what you want -- the C<flash> message will get displayed on
the next screen where it's appropriate, but it won't "keep showing up"
after that first time (unless you reset it). Please refer to
-L<Catalyst::Plugin::Session|Catalyst::Plugin::Session> for additional
+L<Catalyst::Plugin::Session> for additional
information.
Kennedy Clark, C<hkclark@gmail.com>
-Please report any errors, issues or suggestions to the author. The
-most recent version of the Catalyst Tutorial can be found at
+Feel free to contact the author for any errors or suggestions, but the
+best way to report issues is via the CPAN RT Bug system at
+<https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Manual>.
+
+The most recent version of the Catalyst Tutorial can be found at
L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/>.
Copyright 2006-2010, Kennedy Clark, under the