very simple openid on django

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).

2 thoughts on “very simple openid on django

  1. When you said “authorization” you meant “authentication”.

    I think it will always be compulsory to create the user in the system, because the authorization, and the profile of the user must remain in it. The main goal of openid is to have just a login and a password for all systems, but the registration is always needed.

  2. Please, let us now more about the other things you are learning… it’s a way to be updated… I think I have heard about something like this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s