Changes between Version 12 and Version 13 of SharedCookieAuthPlugin
- Timestamp:
- Nov 27, 2015, 4:42:15 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SharedCookieAuthPlugin
v12 v13 1 = Share Trac cookies between projects in the same environment 2 3 {{{#!box info 4 **Notice:** This plugin does not necessarily meet coding standards or functions correctly in all use cases. 5 }}} 1 = Share Trac cookies between projects in the same directory 6 2 7 3 == Description 8 4 9 This plugin allows cookies to be shared between Trac instances in the same environment, ie 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.5 This plugin allows cookies to be shared among Trac environments that reside in the same directory, enabling Single-Sign-On to a collection of Trac sites. 10 6 11 '''Note 1''': 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: 12 {{{#!ini 13 [trac] 14 auth_cookie_path = /var/www/trac 15 }}} 16 17 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. 18 19 '''Note 2''': Before recent maintainer take-over, this plugin inspired a native Single-Sign-On functionality in AccountManagerPlugin, that is stable, available since acct_mgr-0.4 and even solves some of the shortcomings of this plugin. Most importantly login/logout works from any Trac environment sharing identical cookie path settings. 7 **Note**: This plugin inspired a native Single-Sign-On functionality in AccountManagerPlugin, which is available since acct_mgr-0.4 and even solves some of the shortcomings of this plugin. Most importantly login/logout works from any Trac environment sharing identical cookie path settings. 20 8 21 9 == Bugs/Feature Requests … … 39 27 == Installation 40 28 41 Install the plugin on multiple Trac instances in the same directory that use cookie-based auth. Then logging in to one, should mirror login to all of them.29 Install the plugin to multiple Trac environments that use cookie-based auth and reside in the same directory. 42 30 43 31 == Configuration 44 32 45 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.33 You will need to select one of the project to be the master, and thus responsible for authentication. The other (slave) projects should be configured to pass the authenticate request onto the master project. This is to avoid Trac expiring the `auth_cookie` when the login is made in another project. Unfortunately this means that login and logout can only be made in the master project. 46 34 47 So for the slave projects you'll need to disable the normal way of authentication while enabling the sharedcookieauth:35 The slave project will have `LoginModule` disabled and `sharedcookieauth` enabled: 48 36 {{{#!ini 49 37 [components] … … 55 43 }}} 56 44 57 And for the master project:45 The master project will have both `LoginModule` and `sharedcookieauth` enabled: 58 46 {{{#!ini 59 47 [components] … … 65 53 }}} 66 54 67 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 theprojects.55 In practice `sharedcookieauth` does not need to be enabled in the master project, but neither should it cause any harm. Also be aware that the server name must match for each project or the browser will not share the `auth_cookie` among projects. 68 56 69 57 == Recent Changes … … 77 65 '''Author:''' [wiki:k0s] [[BR]] 78 66 '''Maintainer:''' [[Maintainer]] [[BR]] 79 '''Contributors:''' 67 '''Contributors:''' rjollos