Commit | Line | Data |
861c2f44 |
1 | package AuthTestApp; |
2 | use Catalyst qw/ |
3 | Authentication |
4 | /; |
5 | our %users; |
6 | __PACKAGE__->config(authentication => { |
7 | default_realm => 'test', |
8 | realms => { |
9 | test => { |
10 | store => { |
11 | class => 'Minimal', |
12 | users => \%users, |
13 | }, |
14 | credential => { |
15 | class => 'HTTP', |
16 | type => 'basic', |
17 | password_type => 'clear', |
18 | password_field => 'password' |
19 | }, |
20 | }, |
21 | }, |
22 | }); |
23 | sub auto : Private { |
24 | my ($self, $c) = @_; |
25 | $c->authenticate(); |
26 | } |
27 | sub moose : Local { |
28 | my ( $self, $c ) = @_; |
29 | $c->res->body( $c->user->id ); |
30 | } |
31 | %users = ( |
32 | foo => { password => "s3cr3t", }, |
33 | ); |
34 | __PACKAGE__->setup; |