1.1 --- a/examples/Webware/SimpleWithLoginApp/__init__.py Thu Sep 27 22:48:48 2007 +0000
1.2 +++ b/examples/Webware/SimpleWithLoginApp/__init__.py Thu Sep 27 22:49:16 2007 +0000
1.3 @@ -8,18 +8,33 @@
1.4
1.5 from WebStack.Adapters.Webware import WebStackServletFactory
1.6 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.7 +from WebStack.Resources.Login import LoginResource, LoginAuthenticator
1.8 +from WebStack.Resources.ResourceMap import MapResource
1.9 from Simple import SimpleResource
1.10
1.11 # NOTE: Initialising a shared resource.
1.12
1.13 -resource = LoginRedirectResource(
1.14 - login_url="http://localhost/webkit/app.login",
1.15 - app_url="http://localhost",
1.16 - resource=SimpleResource(),
1.17 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.18 - anonymous_parameter_name="anonymous",
1.19 - logout_parameter_name="logout"
1.20 -)
1.21 +resource = MapResource({
1.22 + "simple" :
1.23 + LoginRedirectResource(
1.24 + login_url="http://localhost/webkit/app.login",
1.25 + app_url="http://localhost",
1.26 + resource=SimpleResource(),
1.27 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.28 + anonymous_parameter_name="anonymous",
1.29 + logout_parameter_name="logout"
1.30 + ),
1.31 + "login" :
1.32 + LoginResource(
1.33 + LoginAuthenticator(
1.34 + secret_key="horses",
1.35 + credentials=(
1.36 + ("badger", "abc"),
1.37 + ("vole", "xyz"),
1.38 + )
1.39 + )
1.40 + )
1.41 + })
1.42
1.43 def InstallInWebKit(appServer):
1.44 global resource