Associating application usernames with database connections

C

Chris Berube

I have a question regarding identity propagation and connection pooling.
Where a user logs into an ASP.NET web page or service, access to the database
is done using connections that come from a pool. All these connections are
already connected to the database and they all use the same credentials. I
need a way to get the client's original username (at the app server level)
and IP address, or a way to associate that information with the actual
database connection. For example, I want to do a SET CONTEXT SQL command
passing a string which I can later use from within the database - either in
stored procedures or at least for recording in the audit trail. Any ideas on
how to accomplish this? Ideally, I am looking for a hook where I can register
a callout to my code that gets called every time a connection is retrieved
from the pool. Is this even possible assuming I have no control over the web
pages or services? Are there server wide hooks that can be used to retrieve
this information?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top