1.1 --- a/examples/JavaServlet/SimpleWithLoginApp.py Thu Sep 27 22:39:03 2007 +0000
1.2 +++ b/examples/JavaServlet/SimpleWithLoginApp.py Thu Sep 27 22:39:38 2007 +0000
1.3 @@ -1,20 +1,36 @@
1.4 #!/usr/bin/env python
1.5
1.6 from WebStack.Adapters.JavaServlet import deploy
1.7 +from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.8 +from WebStack.Resources.Login import LoginResource, LoginAuthenticator
1.9 +from WebStack.Resources.ResourceMap import MapResource
1.10 from Simple import SimpleResource
1.11 -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.12
1.13 # NOTE: Not sure if the resource should be maintained in a resource pool.
1.14
1.15 -resource = LoginRedirectResource(
1.16 - login_url="http://localhost:8080/LoginApp/",
1.17 - app_url="http://localhost:8080",
1.18 - resource=SimpleResource(),
1.19 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.20 - anonymous_parameter_name="anonymous",
1.21 - logout_parameter_name="logout"
1.22 - )
1.23 -
1.24 -SimpleWithLoginApp = deploy(resource)
1.25 +SimpleWithLoginApp = deploy(
1.26 + MapResource({
1.27 + "simple" :
1.28 + LoginRedirectResource(
1.29 + login_url="http://localhost:8080/SimpleWithLoginApp/login",
1.30 + app_url="http://localhost:8080",
1.31 + resource=SimpleResource(),
1.32 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.33 + anonymous_parameter_name="anonymous",
1.34 + logout_parameter_name="logout"
1.35 + ),
1.36 + "login" :
1.37 + LoginResource(
1.38 + LoginAuthenticator(
1.39 + secret_key="horses",
1.40 + credentials=(
1.41 + ("badger", "abc"),
1.42 + ("vole", "xyz"),
1.43 + )
1.44 + )
1.45 + )
1.46 + }),
1.47 + handle_errors=1
1.48 +)
1.49
1.50 # vim: tabstop=4 expandtab shiftwidth=4