This is a simple how to for enabling OpenID authentication using Authkit (and Beaker, we need cooookies!!!) over WSGI.
The following snippet is inspired by the (broken?) example I found in the Pylons documentation wiki.
from authkit.authenticate import middleware, sample_app
from beaker.middleware import SessionMiddleware
app = middleware(
sample_app,
setup_method='openid,cookie',
openid_path_signedin='/private',
openid_store_type='file',
openid_store_config='',
cookie_secret='secret encryption string',
cookie_signoutpath = '/signout',
)
app = SessionMiddleware(app, key='mysession', secret='randomsecret')
if __name__ == '__main__':
from paste.httpserver import serve
serve(app, host='0.0.0.0', port=8080)
TODO: fix the broken example in the wiki (:
Tag: authkit, beaker, code, howto, openid, pylons, python, snippet, WSGI
