Skip to content

Commit

Permalink
Add more example
Browse files Browse the repository at this point in the history
  • Loading branch information
miyagawa committed Apr 25, 2024
1 parent ace4de7 commit 24b3867
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/Plack/Middleware/Auth/Basic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,21 @@ A callback function that takes username, password and PSGI environment
supplied and returns whether the authentication succeeds. Required.
Authenticator can also be an object that responds to C<authenticate>
method that takes username and password and returns boolean, so
backends for L<Authen::Simple> is perfect to use:
method that takes username and password and returns boolean, so any
backends for L<Authen::Simple> are perfect to use:
use Authen::Simple::LDAP;
enable "Auth::Basic", authenticator => Authen::Simple::LDAP->new(...);
For authentication based on C<htpasswd> files:
use Authen::Simple::Passwd;
enable "Auth::Basic",
realm => "Password protected area",
authenticator => Authen::Simple::Passwd->new(
path => "/path/to/.htpasswd",
);
=item realm
Realm name to display in the basic authentication dialog. Defaults to I<restricted area>.
Expand Down

0 comments on commit 24b3867

Please sign in to comment.