4 use RT::Test tests => 9;
7 RT->Config->Set( DevelMode => 0 );
8 RT->Config->Set( WebExternalAuth => 1 );
11 return Authorization => "Basic " .
12 MIME::Base64::encode( join(":", @_) );
15 my ( $url, $m ) = RT::Test->started_ok( basic_auth => 1 );
17 is($m->status, 401, "Initial request with no creds gets 401");
19 $m->get($url, auth( root => "wrong" ));
20 is($m->status, 401, "Request with wrong creds gets 401");
22 $m->get($url, auth( root => "password" ));
23 is($m->status, 200, "Request with right creds gets 200");
26 qr{<span class="current-user">\Qroot\E</span>}i,
27 "Has user on the page"
29 $m->content_unlike(qr/Logout/i, "Has no logout button, no WebFallbackToInternalAuth");
32 is($m->status, 401, "Subsequent requests without credentials aren't still logged in");
35 # Put the credentials back for the warnings check at the end
36 $m->default_header( auth( root => "password" ));