Stop forcing $authinfo->{id} to be passed down to the store, instead using just confi...
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / RemoteTestApp2.pm
CommitLineData
b94c4996 1package RemoteTestApp2;
2
3use Catalyst qw/
4 Authentication
5/;
6
7use base qw/Catalyst/;
8__PACKAGE__->engine_class('RemoteTestEngine');
9__PACKAGE__->config(
10 'Plugin::Authentication' => {
11 default_realm => 'remote',
12 realms => {
13 remote => {
14 credential => {
15 class => 'Remote',
16 allow_regexp => '^(bob|john|CN=.*)$',
17 deny_regexp=> 'denied',
18 cutname_regexp=> 'CN=(.*)/OU=Test',
19 source => 'SSL_CLIENT_S_DN',
7289cea0 20 username_field => 'my_user_name',
b94c4996 21 },
22 store => {
23 class => 'Null',
24 },
25 },
26 },
27 },
28);
29
30sub default : Local {
31 my ( $self, $c ) = @_;
32 if ($c->authenticate()) {
69be7d10 33 $c->res->body(
34 'my_user_name:'
35 . $c->user->{my_user_name}
36 );
b94c4996 37 }
38 else {
39 $c->res->body('FAIL');
40 $c->res->status(403);
41 }
42}
43
44sub public : Local {
45 my ( $self, $c ) = @_;
46 $c->res->body('OK');
47}
48
49__PACKAGE__->setup;
50