Share Trac cookies between projects in the same environment

Description

SharedCookieAuthPlugin allows cookies to be shared between Trac instances in the same environment (i.e. directory). The plugin monkey-patches trac.web.auth.LoginModule so that cookies get set at / instead of req.base_path (See following note). The incoming request is then passed by the authenticate method of the IAuthenticator interface to projects that peer the project of interest to see if the user is authenticated there. This enables single-sign on for Trac projects in the same directory.

Note: As per request in T#8486 a new configuration option, has been introduced to Trac with changeset T:[9226], that accomplished this:

[trac]
auth_cookie_path = /var/www/trac

So this has been made a part of Trac, and a simplified plugin version (not yet available) should work for Trac version >= 0.12 without that monkey-patching.

Bugs/Feature Requests

Existing bugs and feature requests for SharedCookieAuthPlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out SharedCookieAuthPlugin from here using Subversion, or browse the source with Trac.

Example

Install the plugin on multiple Trac instances in the same directory that use cookie-based auth. Then login to one should mirror login to all of them

Recent Changes

[6275] by k0s on 07/23/09 20:14:24

point to correct URL

[6241] by k0s on 07/20/09 21:12:16

fix major bug whereby for more than two projects the request never returns

[6222] by k0s on 07/17/09 20:14:30

* better patching * patch the _do_logout method too * bump version

[6218] by k0s on 07/16/09 21:24:38

comment about class-level data

Author/Contributors

Originally developed at The Open Planning Project

Author: k0s
Maintainer: agitronic
Contributors: