Fix broken links and malformed formatting in POD
[catagits/Catalyst-Authentication-Store-Htpasswd.git] / README.pod
CommitLineData
e4c5ea7e 1=pod
2
3=encoding UTF-8
4
5=head1 NAME
6
7Catalyst::Authentication::Store::Htpasswd - Authen::Htpasswd based user storage/authentication
8
9=head1 VERSION
10
bef52fb3 11version 1.006
e4c5ea7e 12
13=head1 SYNOPSIS
14
15 use Catalyst qw/
16 Authentication
17 /;
18
19 __PACKAGE__->config(
20 authentication => {
21 default_realm => 'test',
22 realms => {
23 test => {
24 credential => {
25 class => 'Password',
26 password_field => 'password',
27 password_type => 'self_check',
28 },
29 store => {
30 class => 'Htpasswd',
31 file => 'htpasswd',
32 },
33 },
34 },
bef52fb3 35 },
e4c5ea7e 36 );
37
38 sub login : Global {
39 my ( $self, $c ) = @_;
40
41 $c->authenticate({ username => $c->req->param("login"), password => $c->req->param("password") });
42 }
43
44=head1 DESCRIPTION
45
bef52fb3 46This plugin uses L<Authen::Htpasswd> to let your application use C<< .htpasswd >>
e4c5ea7e 47files for it's authentication storage.
48
49=head1 METHODS
50
51=head2 new
52
53Simple constructor, dies if the htpassword file can't be found
54
55=head2 find_user
56
57Looks up the user, and returns a Catalyst::Authentication::Store::Htpasswd::User object.
58
59=head2 user_supports
60
bef52fb3 61Delegates to L<< Catalyst::Authentication::User->supports|Catalyst::Authentication::User/supports >> or an
62override in L<user_class|/user_class>.
e4c5ea7e 63
64=head2 from_session
65
bef52fb3 66Delegates the user lookup to L<find_user|/find_user>
e4c5ea7e 67
68=head1 CONFIGURATION
69
70=head2 file
71
72The path to the htpasswd file. If the path starts with a slash, then it is assumed to be a fully
bef52fb3 73qualified path, otherwise the path is fed through C<< $c->path_to >> and so normalised to the
e4c5ea7e 74application root.
75
76Alternatively, it is possible to pass in an L<Authen::Htpasswd> object here, and this will be
77used as the htpasswd file.
78
79=head2 user_class
80
81Change the user class which this store returns. Defaults to L<Catalyst::Authentication::Store::Htpasswd::User>.
82This can be used to add additional functionality to the user class by sub-classing it, but will not normally be
83needed.
84
85=head2 user_field
86
87Change the field that the username is found in in the information passed into the call to C<< $c->authenticate() >>.
88
89This defaults to I< username >, and generally you should be able to use the module as shown in the synopsis, however
90if you need a different field name then this setting can change the default.
91
92Example:
93
94 __PACKAGE__->config( authentication => { realms => { test => {
95 store => {
96 class => 'Htpasswd',
97 user_field => 'email_address',
98 },
99 }}});
100 # Later in your code
101 $c->authenticate({ email_address => $c->req->param("email"), password => $c->req->param("password") });
102
103=head1 SEE ALSO
104
105L<Authen::Htpasswd>.
106
107=head1 SUPPORT
108
109Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Authentication-Store-Htpasswd>
110(or L<bug-Catalyst-Authentication-Store-Htpasswd@rt.cpan.org|mailto:bug-Catalyst-Authentication-Store-Htpasswd@rt.cpan.org>).
111
112There is also a mailing list available for users of this distribution, at
113L<http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst>.
114
115There is also an irc channel available for users of this distribution, at
116L<C<#catalyst> on C<irc.perl.org>|irc://irc.perl.org/#catalyst>.
117
118=head1 AUTHOR
119
120יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>
121
122=head1 CONTRIBUTORS
123
bef52fb3 124=for stopwords David Kamholz Tomas Doran Karen Etheridge Tom Bloor Christopher Hoskin Ilmari Vacklin
e4c5ea7e 125
126=over 4
127
128=item *
129
130David Kamholz <dkamholz@cpan.org>
131
132=item *
133
134Tomas Doran <bobtfish@bobtfish.net>
135
136=item *
137
138Karen Etheridge <ether@cpan.org>
139
140=item *
141
142Tom Bloor <t.bloor@shadowcat.co.uk>
143
144=item *
145
bef52fb3 146Christopher Hoskin <christopher.hoskin@gmail.com>
147
148=item *
149
e4c5ea7e 150Ilmari Vacklin <ilmari.vacklin@cs.helsinki.fi>
151
152=back
153
154=head1 COPYRIGHT AND LICENCE
155
156This software is copyright (c) 2005 by יובל קוג'מן (Yuval Kogman).
157
158This is free software; you can redistribute it and/or modify it under
159the same terms as the Perl 5 programming language system itself.
160
161=cut