I am not sure if this is the correct forum - apologies in advance - I could not identify where it should go!
I have an ASP.NET Web Application that uses Forms Authentication using
System.Web.Security.ActiveDirectoryMembershipProvider for signing on using Windows credentials. This works nicely and is solid.
The problem I have is connecting to SQL Server. I need to be able to connect to SQL Server using Windows Authentication
(trusted_connection=yes or Integrated Security=SSPI). This is critical so I can record the user that created/last modified specific records and also to collect "Task-based" records that are relevant to the
currently authenticated user.
I have tried Google and a tonne of variations of web.config entries, using Win API to impersonate etc... The only way that I could make it happen was to:-
1. Use the web.config entry:
(please entry at the bottom of the post. For some reason it won't go into the right spot in this post!)
2. Log on specifically as the user specified in the above web.config entry. If I log on as anyone else (ie Authenticate as anyone else), then SQL server simply gets the ASPNET service account as the Windows user.
I have laboured over this for hours upon hours. I really would appreciate some assistance.
Thanks in Advance,
View Complete Post