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?
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?