Python OpenID

Dan Connolly connolly at
Mon Jul 4 11:40:37 PDT 2005

I can't tell if it's working or not. What's
supposed to happen after step 3 where I
put http://localhost:8082/whoever in the form?

I get page that says "Log In!" and
"No password used because this is just an example."
and when I hit the "Log In" button, it just comes
back to the same page.

Is that as designed? I'm not really clear on how
OpenID works yet.

[I'm resending this now that I'm subscribed...]

Details, including documentation alpha-testing feedback...
(I suggest you note dependency on python2.4 in the README)

I downloaded it...
2e19c86fbda466f263455190d036a6a3  Python-Openid-0.0.1.tar.gz

The lack of a top level README threw me just for a second
or two until I considered the version number and pressed on...

$ cd examples/

Ah... there's the README... so I follow the directions...

$ python
Traceback (most recent call last):
  File "", line 7, in ?
    from openid.consumer import OpenIDConsumer, SimpleHTTPClient
ImportError: No module named openid.consumer

OK, that's easy enough to work around...

$ PYTHONPATH=.. python
Consumer Server running...
Go to http://localhost:8081/ in your browser

Now I'm getting somewhere... I go there... - - [03/Jul/2005 15:42:30] "GET / HTTP/1.1" 200 - - - [03/Jul/2005 15:42:31] "GET /favicon.ico HTTP/1.1" 200

And then in another window...

$ PYTHONPATH=.. python
Traceback (most recent call last):
  File "", line 7, in ?
    from openid.server import OpenIDServer
  File "/home/connolly/src/Python-OpenID-0.0.1/openid/", line
7, in ?
    from openid.trustroot import *
  File "/home/connolly/src/Python-OpenID-0.0.1/openid/",
line 113

Ah... that looks like a 2.4-ism. The default on debian
sid is still...

$ python
Python 2.3.5 (#2, May  4 2005, 08:51:39)

I also saw this 2.4-ism on the server side:
  File "/home/connolly/src/Python-OpenID-0.0.1/openid/", line 50,
in long2a
    return ''.join(reversed(pickle.encode_long(l)))
NameError: global name 'reversed' is not defined

so off to the candy store I go...

$ sudo apt-get install python2.4

and try again...

$ PYTHONPATH=.. python2.4
OpenID Example Server running...

So then I put http://localhost:8082/whoever
in the form...

In the consumer window, I see...

making initial request - - [03/Jul/2005 15:48:06] "GET /?identity_url=http%3A%2F%
2Flocalhost%3A8082%2Fwhoever HTTP/1.1" 302 -

and the server window shows...

$ PYTHONPATH=.. python2.4
OpenID Example Server running... - - [03/Jul/2005 15:46:44] "GET /whoever HTTP/1.0" 200 - - - [03/Jul/2005 15:47:25] "GET /whoever HTTP/1.0" 200 - - - [03/Jul/2005 15:48:05] "GET /whoever HTTP/1.1" 200 -
handling openid.mode='associate' - - [03/Jul/2005 15:48:06] "POST /?action=openid HTTP/1.1"
200 -
handling openid.mode='checkid_setup' - - [03/Jul/2005 15:48:06]
"GET /?action=openid&openid.mode=checkid_setup&openid.identity=http%3A%
HTTP/1.1" 302 - - - [03/Jul/2005 15:48:06]
"GET /?action=allow&trust_root=http%3A%2F%2Flocalhost%3A8081%
3Dcancel HTTP/1.1" 200 - - - [03/Jul/2005 15:48:07] "GET /favicon.ico HTTP/1.1" 200
- - - [03/Jul/2005 15:48:35]
"GET /?action=login&fail_to=http%3A%2F%2Flocalhost%3A8081%2F%
252Flocalhost%253A8081%252F&user=&submit=Log+In HTTP/1.1" 200 - - - [03/Jul/2005 15:48:36] "GET /favicon.ico HTTP/1.1" 200
- - - [03/Jul/2005 15:48:06] "GET /?identity_url=http%3A%2F%
2Flocalhost%3A8082%2Fwhoever HTTP/1.1" 302 -

And that's all I can get it to do.

Dan Connolly, W3C
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E

More information about the yadis mailing list