views:

257

answers:

3

Is it possible to use a database for authentication with Trac? .htpasswd auth is not desired in this install.

Using Trac .11 and MySQL as the database. Trac is currently using the database, but provides no authentication.

+4  A: 

Out of the box, Trac doesn't actually do its own authentication, it leaves it up to the web server. So, you've got a wealth of Apache-related options available to you. You could maybe look at something like auth_mysql to let you keep user credentials in a database.

Alternatively, take a look at the AccountManagerPlugin on trac-hacks.org

Paul Dixon
This seems like the best way to go.
The document you are referring to is uncomplete and four years old.
antispam
Added link to alternative as this is now the accepted answer.
Paul Dixon
+1  A: 

You can use Account Manager Plugin with SessionStore

The AccountManagerPlugin offers several features for managing user accounts:

  • allow users to register new accounts
  • login via an HTML form instead of using HTTP authentication
  • allow existing users to change their passwords or delete their accounts
  • send a new password to users who’ve forgotten their password
  • administration of user accounts
antispam
A: 

Please refer to http://trac-hacks.org/wiki/AccountManagerPlugin

Do the following on your trac.ini [components] ; be sure to enable the component acct_mgr.svnserve.* = enabled acct_mgr.svnserve.svnservepasswordstore = enabled ; choose one of the hash methods acct_mgr.pwhash.htdigesthashmethod = enabled acct_mgr.pwhash.htpasswdhashmethod = enabled

[account-manager] password_store = SvnServePasswordStore password_file = /path/to/svn/repos/conf/passwd ; choose one of the hash methods hash_method = HtDigestHashMethod hash_method = HtPasswdHashMethod

Now trac will use user in the database