Integrated Windows authentication in IIS causing ADO.NET failure

Posted by TrueWill on Stack Overflow See other posts from Stack Overflow or by TrueWill
Published on 2010-05-20T17:16:11Z Indexed on 2010/05/20 17:20 UTC
Read the original article Hit count: 223

We have a .NET 3.5 Web Service running under IIS. It must use identity impersonate="true" and Integrated Windows authentication in order to authenticate to third-party software. In addition, it connects to a SQL Server database using ADO.NET and SQL Server Authentication (specifying a fixed User ID and Password in the connection string).

Everything worked fine until the database was moved to another SQL Server. Then the Web Service would throw the following exception:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

This error only occurs if identity impersonate is true in the Web.config.

Again, the connection string hasn't changed and it specifies the user. I have tested the connection string and it works, both under the impersonated account and under the service account (and from both the remote machine and the server).

What needs to be changed to get this to work with impersonation?

© Stack Overflow or respective owner

Related posts about iis

Related posts about ADO.NET