0

I am building a webpage using Visual Studio 2013 that I want to run internally on my intranet (IIS 8.5) and take advantage of windows authentication or NTLM.

My webpage needs to contain SQL Server connection strings but I want the connection to SQL Server to use the currently logged in user that I can get via windows authentication.

I know that I need to use impersonation to achieve this but I am not sure how, is anyone able to point me in the right direction?

I know my web.config needs to contain

<authentication mode="Windows" />
<identity impersonate="true" />

1 Answer 1

1

There are several pieces that need to be configured in order to achieve this:

  • IIS must be configured for integrated auth
  • Enable "Identity Impersonate" (you've done this)
  • Set Trusted_Connection=Yes in the connection string
  • Add the appropriate users to the database

Here's an MSDN article that goes into more detail: http://msdn.microsoft.com/en-us/library/vstudio/bsz5788z(v=vs.100).aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.