X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FCredential%2FHTTP.pm;h=806f355c18998fcf3d157f5bc04fb1661e21279a;hb=031f556c9ad2c64f19b6feb03e65924d41dfafba;hp=f1ff62bb73787e8cf361e9cf808067b97f578e53;hpb=bf39928587b827d04613b4a7c638a7ca335b7e51;p=catagits%2FCatalyst-Authentication-Credential-HTTP.git diff --git a/lib/Catalyst/Authentication/Credential/HTTP.pm b/lib/Catalyst/Authentication/Credential/HTTP.pm index f1ff62b..806f355 100644 --- a/lib/Catalyst/Authentication/Credential/HTTP.pm +++ b/lib/Catalyst/Authentication/Credential/HTTP.pm @@ -410,6 +410,16 @@ for Catalyst. do_stuff(); } + + sub always_auth : Local { + my ( $self, $c ) = @_; + + # Force authorization headers onto the response so that the user + # is asked again for authentication, even if they successfully + # authenticated. + my $realm = $c->get_auth_realm('example'); + $realm->credential->authorization_required_response($c, $realm); + } # with ACL plugin __PACKAGE__->deny_access_unless("/path", sub { $_[0]->authenticate });