Greg Hewgill ([info]ghewgill) wrote,
@ 2006-12-07 23:02:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
openid
I've been playing with OpenID recently and put together an OpenID identity provider as a little Python script that runs as a CGI under Apache. I wanted to really understand how the protocol works so I did this without the use of any existing OpenID libraries. It turned out to be a little finicky and the current specification leaves a bit to be desired, but with just 140 lines of code I've got a working OpenID provider.

So my OpenID is now http://greg.hewgill.name (the use of .name here isn't specifically related to OpenID, it's just part of an url). What can I do with that? There is a growing list of OpenID enabled software where I can theoretically log in with an OpenID. This means I don't have to give every random web site a password (and have to keep thinking up new ones), I can just use my OpenID knowing that nobody else can use my identity. In practice, adoption is slow but progressing well. I hope to be able to use this on sites like Wikipedia or Trademe (New Zealand's version of ebay) in the near future.

[info]brad did the initial development of OpenID a couple of years ago, so it's no suprise that Livejournal has some of the best support for it. There are two halves to this support: (1) Everybody who has a Livejournal account automatically has an OpenID today, so another OpenID that I could use is http://ghewgill.livejournal.com; (2) People who do not maintain a journal at livejournal.com can still log in to the site, create friends lists, other people can friend them, and so on.

OpenID is really good stuff and hopefully will soon be adopted everywhere. Like other wildly successful protocols such as SMTP, HTTP, and XMPP, nobody owns OpenID so the failure of one company or organisation won't render it useless. And, of course there's no money involved (unlike say, SSL).


(Post a new comment)


[info]cetan
2006-12-07 02:27 pm UTC (link)
I don't really understand OpenID, or at least how to roll my own, but I have used my LJ OpenID in conjunction with Zooomer and I've found the experience to be quite nice.

I wish WordPress had better support for OpenID so LJ'ers could login to post comments on my blog. Some day.

(Reply to this) (Thread)


[info]ghewgill
2006-12-08 05:57 am UTC (link)
There appear to be a multitude of google hits for openid and wordpress, but some of them mention out of date plugins and varying support for wordpress versions. Hopefully something rises out of all that.

(Reply to this) (Parent)


[info]taral
2006-12-07 10:36 pm UTC (link)
OpenID delegation is useful. I can authenticate as http://taral.net/, and it's delegated to livejournal so I don't have to run any software on taral.net.

(Reply to this)


[info]taral
2006-12-07 10:53 pm UTC (link)
60 second associations? Not nice. :(

Also, no worky with simple test:
% nc hewgill.com 80 <<END
POST /services/openid.py HTTP/1.0
Host: hewgill.com

openid.mode=associate
END
HTTP/1.1 200 OK
Date: Thu, 07 Dec 2006 22:52:13 GMT
Server: Apache/2.0.58 (Unix) PHP/4.3.10
Connection: close
Content-Type: text/html

<p>This is an openid server.</p>

(Reply to this) (Thread)


[info]taral
2006-12-07 10:59 pm UTC (link)
Hm. Apparently you have to set content-type.

(Reply to this) (Parent)


[info]ghewgill
2006-12-08 05:32 am UTC (link)
Oh, yeah I had the associate set at 60 seconds for testing. I guess it could be longer than that, what's reasonable? an hour? a day? a month?

Or, I suppose I could try myself against another identity server like livejournal. :)

(Reply to this) (Parent)(Thread)


[info]taral
2006-12-08 06:43 am UTC (link)
It really depends. How long do you want to have to maintain the state on your end? If your design is like mine (stateless), then you can make the association infinite.

(Reply to this) (Parent)(Thread)


[info]ghewgill
2006-12-08 08:03 am UTC (link)
Oh, yeah my server is stateless. My code is pretty hacky, but it's pretty much self-contained. http://hewgill.com/~greg/openid.txt if you're curious. That's the sanitized version with my secrets replaced by FIXME. :)

(Reply to this) (Parent)(Thread)


[info]taral
2006-12-08 08:49 am UTC (link)
Ah, you don't support check_authentication! No wonder your version is so simple.

(Reply to this) (Parent)(Thread)


[info]ghewgill
2006-12-08 08:52 am UTC (link)
Heh yeah. Enough to make it work minimally with the couple of sites I tried it with.

(Reply to this) (Parent)(Thread)


[info]taral
2006-12-08 08:55 am UTC (link)
That's because most of them are smart consumers that can use associations.

(Reply to this) (Parent)


[info]taral
2006-12-08 08:53 am UTC (link)
No trust_root/return_to checking either. Sheesh.

http://taral.dreamhost.com/openid.txt for the one I wrote. It's PHP, but it gives you an idea of how much more has to be done to have a secure IdP.

(Reply to this) (Parent)(Thread)


[info]ghewgill
2006-12-08 09:28 am UTC (link)
Six months ago i couldnt spel programur. Now i are one!

(Reply to this) (Parent)


Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…