Skip to content

how to use WSGI + Authkit + Beaker for OpenID authentication

20 settembre 2009

openid auth form

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 (:

From → computer, English

One Comment
  1. In fact, the recurrent best sneakers for shin splintss became a stumbling block for the budding fashion designer.

Lascia un commento

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...

%d blogger cliccano Mi Piace per questo: