__init__(self,
resource,
authenticator,
login_url=None,
app_url=None,
anonymous_parameter_name=None,
anonymous_username='anonymous',
logout_parameter_name=None,
logout_url='/',
use_logout_redirect=1,
urlencoding=None,
path_encoding=None)
(Constructor)
Initialise the resource with a 'resource' for the application being
protected and an 'authenticator' protecting the resource.
If the optional 'login_url' and 'app_url' are provided, these values
will be used to locate the login application and protected application
respectively. Such values, if not provided, must be otherwise set at a
later time or provided by 'get_login_url' and 'get_app_url' methods in
a subclass of this class.
If the optional 'anonymous_parameter_name' is set, clients providing a
parameter of that name in the URL will not be authenticated, but then
such clients will get a predefined user identity associated with them,
configurable using the optional 'anonymous_username'.
If the optional 'logout_parameter_name' is set, clients providing a
parameter of that name in the URL will become logged out. After logging
out, clients are redirected to a location which can be configured by the
optional 'logout_url'.
If the optional 'use_logout_redirect' flag is set to 0, a confirmation
screen is given instead of redirecting the user to the 'logout_url'.
The optional 'path_encoding' parameter (previously 'urlencoding', which
is still supported) allows a special encoding to be used in producing
the redirection path.
To change the page used by this resource, either redefine the
'logout_page' attribute in instances of this class or a subclass, or
override the 'show_logout' method.
-
|