I'm creating an ASP.NET application for my company.
In Visual Studio, I used EntityFramework to connect to my SQL Server database with an edmx file. The application is using Windows authentication to connect to both the website and SQL Server.
When I run the application locally, all is working great. The Windows authentication works so my app know who I am, then it connects to SQL Server correctly and shows up data.
But when I try to deploy it on my IIS Server, I get the following error :
Login failed for user 'DOMAIN\SERVERNAME$'.
The Windows authentication works great to identify who I am in the app, but the integrated security used to connect to SQL Server is using the server identity instead of the identity of the application's user.
What you may want to know :
- All users have an SQL Server account to connect through integrated security
- The server is on the same Domain than our computers
- The SQL Server is on another server than the machine where IIS is running, but the remote connection is activated and working
- I'm using Google Chrome to test my app locally and remotely
There is the connection string I am using :
<connectionStrings>
<add name="DatabaseEntities" connectionString="metadata=res://*/Models.DatabaseModel.csdl|res://*/Models.DatabaseModel.ssdl|res://*/Models.DatabaseModel.msl;provider=System.Data.SqlClient;provider connection string="data source=SQLSERVERNAME\INSTANCE;initial catalog=Database;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />
Is it possible to use the same Windows authentication for both ASP.NET application and SQL Server ?
