WebOid
A library for implementing an OpenID consumer in a web.py environment.
Code, bug tracking, etc. at https://code.launchpad.net/~weboids/webpy/weboid.
Oct 12, 2009
Once again - I give up. Sessions don't really work (and web.py folks had 2 years to make sure it does). The mailing list proves to be cooperative as long as you don't ask anything about sessions. I'll try Django instead.
Oct 9, 2009
After 2 years of mucking about, there's finally a version that
- Works with web.py ver 0.3x (tested with 0.32)
- Doesn't use genshi (not that it's bad, but it was yet another dependency
)
Usage
from weboid import oid
# add oid_login etc. urls
urls=(...)+oid.OID_URLS
# page allowed only for a list of openid users
class secret_page:
@oid.checkaccess(['james.sis.gov.uk','bond.mi6.co.uk'])
def GET(self):
# return secret html
def myacl(openid_url,arg):
# return True if authorized. arg is user defined
# and passed through the @oid.checkaccess() decorator
class vip_page:
@oid.checkaccess('vip',myacl)
def GET(self):
# return vip html
class die:
"Neat trick to reset your wsgi app when you change a template etc."
@oid.checkaccess(SUPER_USERS)
def get(self):
sys.exit(0)
dependencies
deployment of example app
Standalone:
python app.py and browse to http://localhost:8989
(You can change STANDALONE_PORT at config.py)
WSGI:
Read htaccess.wsgi
(tested with apache2+mod_wsgi)
FCGI:
No longer supported
(tried on apache and sessions went funny)
changed October 12, 2009