# HG changeset patch # User paulb # Date 1209678384 0 # Node ID 7f2ee7b77ecd047c7c48d40e3a52b23466ca9626 # Parent d9b2944bb1a124917dab76b646e5e9abdc1a0144 [project @ 2008-05-01 21:46:24 by paulb] Added OpenID examples, although the login example will not yet work with CGI until a persistent association store is implemented. diff -r d9b2944bb1a1 -r 7f2ee7b77ecd examples/CGI/OpenIDLoginHandler.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/CGI/OpenIDLoginHandler.py Thu May 01 21:46:24 2008 +0000 @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +# Uncomment and adjust the paths below if WebStack is not installed somewhere +# on the PYTHONPATH. + +#import sys +#sys.path.append("/home/paulb/Software/Python/WebStack") +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters.CGI import deploy +from OpenIDLogin import get_site_map + +app_url = "http://localhost" # No trailing "/"! +deployment_url = "http://localhost/cgi/openidlogin" # No trailing "/"! +resource = get_site_map(app_url, deployment_url) + +deploy(resource, handle_errors=0) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r d9b2944bb1a1 -r 7f2ee7b77ecd examples/CGI/SimpleWithOpenIDHandler.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/CGI/SimpleWithOpenIDHandler.py Thu May 01 21:46:24 2008 +0000 @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +# Uncomment and adjust the paths below if WebStack is not installed somewhere +# on the PYTHONPATH. + +#import sys +#sys.path.append("/home/paulb/Software/Python/WebStack") +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters.CGI import deploy +from SimpleWithOpenID import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/cgi/myapp/requestid + +initiation_url = "http://localhost/cgi/simplewithopenid/login" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 + +app_url = "http://localhost" + +# Must match the key used elsewhere. + +secret_key = "horses" + +resource = get_site_map(app_url, initiation_url, secret_key) + +deploy(resource, handle_errors=0) + +# vim: tabstop=4 expandtab shiftwidth=4