Trac - with LDAP Authetication change Domain

16 views
Skip to first unread message

Bua

unread,
Mar 27, 2012, 2:05:31 PM3/27/12
to Trac Users
Dear reader,
i have a question about the User alignment in the Trac system.

the situation:
we integrate a new company in our company, and they use the Trac
system.
This system is configured to access the Page over LDAP in their Active
Directory
And everything is working, ticket assignment will have their Username
from Active Directory.

now my problem and question:
Now they change the Windows Domain and their AD-Accounts. And the User
alignment of the old
Users/Domain will be loosed. Is it possible to change the alignment in
the Trac database to the new UserID!? Or what can i do to solve this.

ATTETION i cannot use any other fields of Active Directory to
authenticate the User to Trac. We use
another Identity Management system (UserMetaDB) that synchronize with
Active Directory.

I hope everyone has an idea or an solution for that.
many thanks' for any solution or idea!

best regards,
Bua

Cooke, Mark

unread,
Mar 28, 2012, 4:38:09 AM3/28/12
to trac-...@googlegroups.com
Well... If you use apache and mod_wsgi, you could add some python into your WSGI scrpit to do a lookup and convert the new usernames to the old ones, and keep all the data the same. Not sure I recommend this as it does not fix your problem and depending on the number of users it will slow down each request...

Partial example:
{{{

def application(environ, start_response):
# Make sure usernames are lower case...
environ['REMOTE_USER'] = environ['REMOTE_USER'].lower()

# Strip any domain if present (should only ever be one)
while "\\" in environ['REMOTE_USER']:
environ['REMOTE_USER'] = environ['REMOTE_USER'].split("\\", 1)[1]

# Do lookup here...

environ['trac.env_parent_dir'] = r'/parent/path'

return trac.web.main.dispatch_request(environ, start_response)
}}}

If that doesn't work for you, you could take all your trac instances offline and run some SQL statements to update all of the data records with the new values. I suspect this could be a lot of work but there may well be plugins at trac-hacks.org to help with some of this (something like batchmodifyplugin for example).

~ mark c

Reply all
Reply to author
Forward
0 new messages