Friday, March 9, 2012

How to set my ASP.NET application to access SQL Server 2005 using clients user credentials

Hi guys,

I'm not sure if I'm just bad at googling but I can't seem to find a way to set an ASP.NET 2.0 web application to connect to SQL Server 2005 using the current client's user credentials. My web application is using Integrated Windows Authentication so its Page.User.Identity is set to a DOMAIN\username value... I want to pass that to my connectionstring or have my connections pick up the identity automatically and use that Identity when accessing the db server.

Oh and another thing, my IIS Application Pool is using a specific Identity itself, so I don't know if that might affect the above.

Hope someone could help.

Hi,

what you need is process impersonation, that allows asp.net to switch the execute owner to an other user. I have used this for asp.net and remoting calls, so that i have the original caller. I have two links for you:

http://msdn2.microsoft.com/en-us/library/ms998292.aspx|||Thanks Zhou. I'll the articles out once I get my hands on our dev server.Stick out tongue Thanks.

No comments:

Post a Comment