wiki:SharedCookieAuthPlugin

Version 1 (modified by k0s, 5 years ago) (diff)

New hack SharedCookieAuthPlugin, created by k0s

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 (though see trac:#8486 for the request to make this configurable). 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.

Currently, this is pretty slow, as all of the peer environments are opened per authentication attempt. Any help making it faster is welcome, or I'll probably eventually get around to it.

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

[12348] by agitronic on 2012-11-14 17:59:08
Fix multiple call to authenticate problem, closes #5566.

There seem to be a possibility that the authenticate method is
called multiple times during the processing of a request.

Also the '0.11' directory has been renamed to 'trunk' and monkey
patching has been disabled.

[11456] by agitronic on 2012-04-07 11:06:22
Updated maintainer field.
[6275] by k0s on 2009-07-23 20:14:24
point to correct URL

Author/Contributors

Author: k0s
Contributors: