1.1 --- a/examples/CGI/SimpleWithLoginHandler.py Thu Sep 27 22:39:03 2007 +0000
1.2 +++ b/examples/CGI/SimpleWithLoginHandler.py Thu Sep 27 22:39:38 2007 +0000
1.3 @@ -9,21 +9,36 @@
1.4
1.5 from WebStack.Adapters.CGI import deploy
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 deploy(
1.12 - LoginRedirectResource(
1.13 - login_url="http://localhost/cgi/login", # Change this to be the exact URL on your server.
1.14 - # eg. http://localhost:8000/cgi/LoginHandler.py
1.15 - app_url="http://localhost", # Change this to be the URL base for your server.
1.16 - # eg. http://localhost:8000
1.17 - # Note that the login application can be placed on
1.18 - # a different server if desirable.
1.19 - resource=SimpleResource(),
1.20 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.21 - anonymous_parameter_name="anonymous",
1.22 - logout_parameter_name="logout"
1.23 - ),
1.24 + MapResource({
1.25 + "simple" :
1.26 + LoginRedirectResource(
1.27 + login_url="http://localhost/cgi/login", # Change this to be the exact URL on your server.
1.28 + # eg. http://localhost:8000/cgi/LoginHandler.py
1.29 + app_url="http://localhost", # Change this to be the URL base for your server.
1.30 + # eg. http://localhost:8000
1.31 + # Note that the login application can be placed on
1.32 + # a different server if desirable.
1.33 + resource=SimpleResource(),
1.34 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.35 + anonymous_parameter_name="anonymous",
1.36 + logout_parameter_name="logout"
1.37 + ),
1.38 + "login" :
1.39 + LoginResource(
1.40 + LoginAuthenticator(
1.41 + secret_key="horses",
1.42 + credentials=(
1.43 + ("badger", "abc"),
1.44 + ("vole", "xyz"),
1.45 + )
1.46 + )
1.47 + )
1.48 + }),
1.49 handle_errors=1
1.50 )
1.51