Version 4 (modified by Brad Anderson, 11 years ago) (diff)

clarification, adding examples

DB Authentication Plugin


A plugin to replace the default Trac auth plugin. It allows for users/groups to be stored in a database (SQLite, and soon, PostgreSQL, MySQL, MS SQL), true login/logout, can serve multiple projects, and maintains cookies so you can keep the login for longer than just one session.

Bugs/Feature Requests

Existing bugs and feature requests for DbAuthPlugin are here.

If you have any issues, create a new ticket.


Download the zipped source from [download:dbauthplugin here].


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

Usage / Install

  • In the install/ directory, you will find a SQLite script to create the three tables needed. You will then have to populate those tables with insert statements. The envname fields in each of the tables is the name of your Trac environment. Note the 'all' envname will allow the user to be in all environments, but have only one row in the table (multiple projects).
    sqlite> insert into trac_permissions values ('all', 'brad', 'admins');
    sqlite> insert into trac_users values ('all','brad','brad','');
  • If you add users/groups to the table(s), you'll need to give them permissions in trac-admin or webadmin plugin.
    % trac-admin /path/to/env permission add admins TRAC_ADMIN
  • If you would like to restrict_owner on tickets to only be the users in your tables, you need to make use of the file. You will need to see Ticket 2456 at p.e.c, and patch Trac accordingly.
  • Make these changes in the global trac.ini file, or your environment's trac.ini file. The global one may make more sense, because this plugin is used across environments:
    trac.web.auth.* = disabled
    dbauth.* = enabled
    trac.userdir.* = enabled  # only if you want to use this
    database = /home/brad/dev/python/trac-dbauth/install/dbauth.db
    envroot = /var/trac/
  • As of [428], I only have SQLite working, but want to have a CentralDatabaseManager that can do more backends. It appears that this will have to be for the 0.10.x and higher branches.


Recent Changes

2155 by wkornew on 2007-04-03 09:59:27

Fixed for Genshi trunk.

2154 by wkornew on 2007-04-02 10:15:48

Updated to Trac 0.11. Changing the password is not possible (I'll have to add an extension to the new prefs interface in Trac 0.11).

2150 by wkornew on 2007-04-01 19:52:17

Created simple-0.10 branch in preparation for 0.11 updates.



Author: brad
Contributors: Karol Krizka, borrowed heavily from Jonas's original work


Attachments (1)

Download all attachments as: .zip