= 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 [trac:ticket:8486 T#8486] a new configuration option, has been introduced to Trac with changeset [trac:changeset:9226 'T:[9226]'], that accomplished this: {{{ #!cfg [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. == Configuration == To make this work you will need to select one of the project to be the master authenticator, the other (slave) projects should be configured to pass the authenticate request onto the master project. This is to avoid one project to kill the auth_cookie if the login was made in another project. Unfortunately this means that login and logout can only be made in the master project. So for the slave projects you'll need to disable the normal way of authentication while enabling the sharedcookieauth: {{{ #!cfg [components] sharedcookieauth.* = enabled trac.web.auth.LoginModule = disabled [trac] auth_cookie_path = / }}} And for the master project: {{{ #!cfg [components] sharedcookieauth.* = enabled trac.web.auth.LoginModule = enabled [trac] auth_cookie_path = / }}} The sharedcookieauth should not need to be enabled in the master project, but it shouldn't harm either. Also be aware that the server name used must match or the browser will not share the auth_cookie between the projects == Bugs/Feature Requests == Existing bugs and feature requests for SharedCookieAuthPlugin are [report:9?COMPONENT=SharedCookieAuthPlugin here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=SharedCookieAuthPlugin&owner=agitronic new ticket]. == Download == Download the zipped source from [download:sharedcookieauthplugin here]. == Source == You can check out SharedCookieAuthPlugin from [http://trac-hacks.org/svn/sharedcookieauthplugin here] using Subversion, or [source:sharedcookieauthplugin 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 == [[ChangeLog(sharedcookieauthplugin, 3)]] == Author/Contributors == ''Originally developed at [http://openplans.org The Open Planning Project]'' '''Author:''' [wiki:k0s] [[BR]] '''Maintainer:''' [wiki:agitronic] [[BR]] '''Contributors:'''