[albatross-users] Problem with command-line parsing. Affects OpenID auth

Andrew McNamara andrewm at object-craft.com.au
Fri Mar 16 10:04:08 EST 2007


>I'm trying to write an Albatross wrapper for OpenID, and one of the
>phases of authentication is when the OpenID server redirects to
>something like:
>http://myserver/login_continue?openid.assoc_handle=%7BHMAC-SHA1%...
>Nothing I can do about it. OpenID is not MY standard
>
>openid.assoc_handle gets parsed and this raises an error:
>
>Traceback (most recent call last):
>  File "/usr/lib/python2.4/site-packages/albatross/app.py", line 282, in run
>    self.merge_request(ctx)
>  File "/usr/lib/python2.4/site-packages/albatross/app.py", line 366,
>in merge_request
>    ctx.merge_request()
>  File "/usr/lib/python2.4/site-packages/albatross/context.py", line
>332, in merge_request
>    self.set_value(name, value)
>  File "/usr/lib/python2.4/site-packages/albatross/context.py", line
>418, in set_value
>    parent = getattr(parent, elem)
>AttributeError: Vars instance has no attribute 'openid'
>    in al-input field "openid.assoc_handle"
>
>I'm gonna patch the lib or something to make it work, but there should
>be a sane way to cope with OpenID
>
>Any help with tricks around this problem will be appreciated.

The simplest answer is to put an object called openid into ctx.locals.
After the page loads, the dummy object will have an attribute
"assoc_handle", and you can do with this what you please.

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/



More information about the Albatross-users mailing list