Discussion:
[albatross-users] Problem with command-line parsing. Affects OpenID auth
Uncle Zzzen
2007-03-15 03:53:33 UTC
Permalink
Hi.
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.

Cheers,
The Dod
Andrew McNamara
2007-03-15 23:04:08 UTC
Permalink
Post by Uncle Zzzen
I'm trying to write an Albatross wrapper for OpenID, and one of the
phases of authentication is when the OpenID server redirects to
http://myserver/login_continue?openid.assoc_handle=%7BHMAC-SHA1%...
Nothing I can do about it. OpenID is not MY standard
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/
Uncle Zzzen
2007-03-15 23:39:33 UTC
Permalink
Post by Andrew McNamara
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.
It worked.
I've subclassed the context and added
self.locals.openid=albatros.context.Vars()
at the end of __init__
Thanks.

--
"What do you give a man who has everything? A condom, unless you also
want to have what he's got" -- Um Zeresh

gpg: http://zzzen.com/zzzen.asc
fingerprint(0x7F1BCD50) = 0FEE 7BA9 6F1C 23F9 BACD 0F72 6434 F9A7 7F1B CD50
--
"What do you give a man who has everything? A condom, unless you also
want to have what he's got" -- Um Zeresh

gpg: http://zzzen.com/zzzen.asc
fingerprint(0x7F1BCD50) = 0FEE 7BA9 6F1C 23F9 BACD 0F72 6434 F9A7 7F1B CD50
Loading...