add README
[catagits/Catalyst-Authentication-Credential-HTTP-Proxy.git] / README
1 NAME
2     Catalyst::Plugin::Authentication::Credential::HTTP::Proxy - HTTP Proxy
3     authentication for Catlayst.
4
5 SYNOPSIS
6         use Catalyst qw/
7             Authentication
8             Authentication::Store::Moose
9             Authentication::Store::Elk
10             Authentication::Credential::HTTP::Proxy
11         /;
12
13         $c->config->{authentication}{http_proxy}= {
14             url  =>'http://elkland.no/auth',
15             store => 'Authentication::Store::Moose'
16         };
17     
18         sub foo : Local { 
19             my ( $self, $c ) = @_;
20
21             $c->authorization_required( realm => "foo" ); # named after the status code ;-)
22
23             # either user gets authenticated or 401 is sent
24
25             do_stuff();
26         }
27
28         # with ACL plugin
29         __PACKAGE__->deny_access_unless("/path", sub { $_[0]->authenticate_http });
30
31         sub end : Private {
32             my ( $self, $c ) = @_;
33
34             $c->authorization_required_response( realm => "foo" );
35             $c->error(0);
36         }
37
38 DESCRIPTION
39     This moduule lets you use HTTP Proxy authentication with
40     Catalyst::Plugin::Authentication.
41
42     Currently this module only supports the Basic scheme, but upon request
43     Digest will also be added. Patches welcome!
44
45 CONFIG
46     This module reads config from $c->config->{authentication}{http_proxy}.
47     The following settings are supported:
48
49     url Required. A url protected with basic authentication to authenticate
50         against.
51
52     store
53         To specify what store to use. will use the default store if not set.
54
55 METHODS
56     authorization_required
57         Tries to "authenticate_http_proxy", and if that fails calls
58         "authorization_required_response" and detaches the current action
59         call stack.
60
61     authenticate_http_proxy
62         Looks inside "$c->request->headers" and processes the basic (badly
63         named) authorization header. Then authenticates this against the
64         provided url.
65
66     authorization_required_response
67         Sets "$c->response" to the correct status code, and adds the correct
68         header to demand authentication data from the user agent.
69
70 AUTHORS
71     Marcus Ramberg <mramberg@cpan.org
72
73 COPYRIGHT & LICENSE
74             Copyright (c) 2005 the aforementioned authors. All rights
75             reserved. This program is free software; you can redistribute
76             it and/or modify it under the same terms as Perl itself.
77