1 package AuthRealmTestApp;
7 Authentication::Store::Minimal
29 my ( $self, $c ) = @_;
31 ok(!$c->user, "no user");
33 while ( my ($user, $info) = each %$members ) {
37 { username => $user, password => $info->{password} },
40 "user $user authentication"
43 # check existing realms
44 ok( $c->user_in_realm('members'), "user in members realm");
45 ok(!$c->user_in_realm('admins'), "user not in admins realm");
47 # check an invalid realm
48 ok(!$c->user_in_realm('foobar'), "user not in foobar realm");
50 # check if we've got the right user
51 is( $c->user, $info, "user object is in proper place");
56 ok(!$c->user, "no more user after logout");
60 while ( my ($user, $info) = each %$admins ) {
64 { username => $user, password => $info->{password} },
67 "user $user authentication"
70 # check existing realms
71 ok(!$c->user_in_realm('members'), "user not in members realm");
72 ok( $c->user_in_realm('admins'), "user in admins realm");
74 # check an invalid realm
75 ok(!$c->user_in_realm('foobar'), "user not in foobar realm");
77 # check if we've got the right user
78 is( $c->user, $info, "user object is in proper place");
83 ok(!$c->user, "no more user after logout");
87 $c->res->body( "ok" );
90 __PACKAGE__->config->{'Plugin::Authentication'} = {
91 default_realm => 'members',
96 password_field => 'password',
97 password_type => 'clear'
107 password_field => 'password',
108 password_type => 'clear'