Released RequireSSL 0.03: code cleanup and Static::Simple support
[catagits/Catalyst-Plugin-RequireSSL.git] / README
1 NAME
2     Catalyst::Plugin::RequireSSL - Force SSL mode on select pages
3
4 SYNOPSIS
5         # in MyApp.pm
6         use Catalyst;
7         MyApp->setup( qw/RequireSSL/ );
8     
9         MyApp->config->{require_ssl} = {
10             https => 'secure.mydomain.com',
11             http => 'www.mydomain.com',
12             remain_in_ssl => 0,
13         };
14
15         # in any controller methods that should be secured
16         $c->require_ssl;
17
18 DESCRIPTION
19     Use this plugin if you wish to selectively force SSL mode on some of
20     your web pages, for example a user login form or shopping cart.
21
22     Simply place $c->require_ssl calls in any controller method you wish to
23     be secured.
24
25     This plugin will automatically disable itself if you are running under
26     the standalone HTTP::Daemon Catalyst server. A warning message will be
27     printed to the log file whenever an SSL redirect would have occurred.
28
29 WARNINGS
30     If you utilize different servers or hostnames for non-SSL and SSL
31     requests, and you rely on a session cookie to determine redirection (i.e
32     for a login page), your cookie must be visible to both servers. For more
33     information, see the documentation for the Session plugin you are using.
34
35 CONFIGURATION
36     Configuration is optional. You may define the following configuration
37     values:
38
39         https => $ssl_host
40     
41     If your SSL domain name is different from your non-SSL domain, set this
42     value.
43
44         http => $non_ssl_host
45     
46     If you have set the https value above, you must also set the hostname of
47     your non-SSL server.
48
49         remain_in_ssl
50     
51     If you'd like your users to remain in SSL mode after visiting an
52     SSL-required page, you can set this option to 1. By default, this option
53     is disabled and users will be redirected back to non-SSL mode as soon as
54     possible.
55
56 METHODS
57   require_ssl
58     Call require_ssl in any controller method you wish to be secured.
59
60         $c->require_ssl;
61
62     The browser will be redirected to the same path on your SSL server. POST
63     requests are never redirected.
64
65 KNOWN ISSUES
66     When viewing an SSL-required page that uses static files served from the
67     Static plugin, the static files are redirected to the non-SSL path.
68
69     In order to get the correct behaviour where static files are not
70     redirected, you should use the Static::Simple plugin or always serve
71     static files directly from your web server.
72
73 SEE ALSO
74     Catalyst, Catalyst::Plugin::Static::Simple
75
76 AUTHOR
77     Andy Grundman, <andy@hybridized.org>
78
79 COPYRIGHT
80     This program is free software, you can redistribute it and/or modify it
81     under the same terms as Perl itself.
82