Add an example of how to call authorization_required_response (you used to just be...
[catagits/Catalyst-Authentication-Credential-HTTP.git] / lib / Catalyst / Authentication / Credential / HTTP.pm
index f1ff62b..806f355 100644 (file)
@@ -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 });