wiki:SharedCookieAuthPlugin

Version 13 (modified by Ryan J Ollos, 8 years ago) (diff)

Plugin has been revised for Trac 0.12 and later.

Share Trac cookies between projects in the same directory

Description

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.

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.

Bugs/Feature Requests

Existing bugs and feature requests for SharedCookieAuthPlugin are here.

If you have any issues, create a new ticket.

defect

2 / 2

enhancement

1 / 1

task

1 / 1

Download

Download the zipped source from here.

Source

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

Installation

Install the plugin to multiple Trac environments that use cookie-based auth and reside in the same directory.

Configuration

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.

The slave project will have LoginModule disabled and sharedcookieauth enabled:

[components]
sharedcookieauth.* = enabled
trac.web.auth.LoginModule = disabled

[trac]
auth_cookie_path = /

The master project will have both LoginModule and sharedcookieauth enabled:

[components]
sharedcookieauth.* = enabled
trac.web.auth.LoginModule = enabled

[trac]
auth_cookie_path = /

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.

Recent Changes

15486 by rjollos on 2016-04-18 08:56:13
0.1.6dev: Refactor code and update documentation
15122 by rjollos on 2015-12-14 06:13:30
0.1.5: Tag sharedcookieauth-0.1.5

Bump trunk version to 0.1.6dev.

15091 by rjollos on 2015-12-01 18:21:00
0.1.5dev: Rename method added in [15075]

  • Document internal methods.

Refs #12592

(more)

Author/Contributors

Originally developed at The Open Planning Project

Author: k0s
Maintainer: agitronic
Contributors: rjollos