As most of you know, I am learning a some bits of django, and some other things.
I am just wanted to share how incredibly easy is to use openid inside a django application. It’s really nice to have login users without the need to ask them username/password. This is the way openid works, you just have to login on any openid server, and when you use this openid authorization authentication to login on a website that supports openid, the second one consume the authorization authentication from the first openid server.
In terms of django and open id, what we have is djagno-openid which let us become a openid consumer and also django-openid-auth, which integrates django-openid and django authentication. It means that when you login with the open id (for me, my open id is https://robertrv.wordpress.com … ), this openid is linked to the user on the django authentication system, being able to have all the roles (super user, stuff .. etc)
To have it working, what we have to do is mainly use the django-openid-auth documentation, where explains the following steps:
- Install python-openid (version 1.2 or 2, I tried with 1.2). The documentation says that you have to download the “combo” package, but I didn’t found it … so I installed other two other packages:
- There is a dependency not explained on the documentation: elementtree.ElementTree
- Then you need the django-openid.
- Finally the proper django-openid-auth
- And now, you have an example application on the django-openid-auth named: djopenid_example. But to have it working you have to apply this patch to the file djopenid_example/djopenid/views.py
And then you will have the openid working ! I’ll try in the future post some more comments to explain how to create users directly with this openid, now is mandatory to create an user and link it to some openid.
UPDATE 20/05/2008: Thanks bosco, obviously is just authentication, the authoritzation in this case is internally managed by the openid consumer, in this case django (NOTE: is not good to post so late at night).