How would you audit ASP.NET Membership tables, while recording what user made the changes?

Posted by Pete on Stack Overflow See other posts from Stack Overflow or by Pete
Published on 2010-05-25T18:48:22Z Indexed on 2010/05/25 18:51 UTC
Read the original article Hit count: 402

Using a trigger-based approach to audit logging, I am recording the history of changes made to tables in the database. The approach I'm using (with a static sql server login) to record which user made the change involves running a stored procedure at the outset of each database connection. The triggers use this username when recording the audit rows. (The triggers are provided by the product OmniAudit.)

However, the ASP.NET Membership tables are accessed primarily through the Membership API. I need to pass in the current user's identity when the Membership API opens its database connection. I tried subclassing MembershipProvider but I cannot access the underlying database connection.

It seems like this would be a common problem. Does anyone know of any hooks we can access when the ASP.NET Membership makes its database connection?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-membership