pyramid-openid 0.3.4

A view for pyramid that functions as an OpenID consumer
pyramid-openid is a Pyramid extension that provides a view that acts as an OpenID consumer.

This code is offered under the BSD-derived Repoze Public License.

Much of this code was inspired by (read: 'lifted from') the repoze.who.plugins.openid code which can be found here: http://quantumcore.org/docs/repoze.who.plugins.openid

In your Pyramid app, add the pyramid_openid.verify_openid view_callable to your view_configuration, and add the needed settings to your .ini file.

Here is a barebones setup:

openid.store.type = file
openid.store.file.path = %(here)s/sstore
openid.success_callback = myapp.lib:remember_me


This setup requires you have a folder in your app directory called 'sstore', and that you have a callback function in your lib module named "remember_me". Remember_me will receive the current request and the other information returned from the OpenID provider, and should then do whatever is needed to remember the user - pyramid.security.remember, load metadata into the session, etc - that part is completely up to the coder.

This setup will then assume the defaults for the rest of the keys.

Once the configuration is in place, it's time to hook up the view to the application. You can do this however you want to.

Example:


In your app config setup code, add this line before 'return config.make_wsgi_app()'

config.add_route('verify_openid',
        pattern='/dologin.html',
        view='pyramid_openid.verify_openid')


Now you have a URL to submit your OpenID form to: /dologin.html. Based on the configuration above, it expects to find the user's OpenID URL in request.params['openid'].

last updated on:
January 14th, 2011, 4:03 GMT
price:
FREE!
developed by:
Tom Likestorock
homepage:
pypi.python.org
license type:
BSD License 
category:
ROOT \ Internet \ HTTP (WWW)

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Rate it!

Add your review!

SUBMIT