OpenID and Trac

2007-01-08 2-minute read

With OpenID installed, I wanted to get the OpenID trac module working.

I started by installing some prerequisites:

apt-get install python-setuptools python-crypto python-elementtree

I then downloaded some python software not in the Debian Repository:

For each of these, I untarred them and then ran:

python setup.py install

Sadly it installed them into the /usr/lib/python directories (rather than /usr/local/lib). Probably a way to get that to work, but I don’t know enough about Python to really know where to start.

Next I added the following to my apache installation:

<Location "/">
SetEnv PYTHON_EGG_CACHE "/srv/trac/support/egg_cache"
</Location>

I created the directory specified and made sure the web server had write access to it.

Then, I downloaded the Trac OpenID plugin here: http://trac-hacks.org/wiki/OpenidPlugin

After downloading, I untarred it, entered the directory and ran:

python setup.py bdist_egg

And then copied the resulting .egg file (which was put in the dist directory) into /srv/trac/support/modules

Finally I added the following to my trac.ini file:

[components]
trac.web.auth.* = disabled
openidauth.* = enabled

And I commented out the “Location /projectname/login” lines in my apache auth file.

And restarted Apache.

Well, it’s almost there. When I enter my OpenID login I get:

Traceback (most recent call last):
File "/var/lib/python-support/python2.4/trac/web/main.py", line 387, in dispatch_request
dispatcher.dispatch(req)
File "/var/lib/python-support/python2.4/trac/web/main.py", line 237, in dispatch
resp = chosen_handler.process_request(req)
File "build/bdist.linux-i686/egg/openidauth/auth.py", line 162, in process_request
File "build/bdist.linux-i686/egg/openidauth/auth.py", line 203, in _start_login
File "build/bdist.linux-i686/egg/openidauth/auth.py", line 199, in _getConsumer
AttributeError: 'module' object has no attribute 'Consumer'

To be continued…