Hello,
I hate to be the 12345th person to request assistance on this topic, but despite looking at previous requests, I can't seem to find the solution. Any assistance you could offer would be much appreciated.
Background
I have a new ASP.NET 2.0 web application which is hosted on (for argument's sake) WEBSERVER (using IIS 6.0), and which accesses data on SQLSERVER (using SQL Server 2000).
Because this is an intranet application, I want the application's authentication mode to be Windows, and the IIS authentication mode to be Integrated Windows (with Anonymous access disabled). ie: IIS should authenticate the user as smithjohn and SQLSERVER should also authenticate the user as smithjohn.
I don't know if this is relevant, but because of an existing nasty Windows application, all relevant domain users already have their own <DOMAIN>\<username> User account on SQLSERVER.
Error
When I build and browse the pages in Visual Web Developer Express, I can retrieve information from SQLSERVER without any problems.
When I publish the site, and upload it to WEBSERVER, I get the following error upon attempting to retrieve data from a stored procedure on SQLSERVER:
System.Data.SqlClient.SqlException: Login failed for user '<DOMAIN>\<WEBSERVER>$'. at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at snapshot.btnGo_Click(Object sender, EventArgs e)
More Detail
- Connection String (in Web.Config):
- <add name="strConnMyDatabase" connectionString="Data Source=SQLSERVER;Initial Catalog=MyDatabase;Integrated Security=True" providerName="System.Data.SqlClient"/>
- Authentication Type (in Web.Config)
- <authentication mode="Windows"/>
- There are no impersonation settings defined in Web.Config
- IIS 'Directory Security' settings are:
- Anonymous Access disabled
- Integrated Windows authentication enabled
- The stored procedure (usp_MyProcedure) has the following execute permissions:
- DOMAIN\Domain Users
- SQLSERVER\MyRole (to which my SQL Server User account belongs)
Questions
- Is it possible to achieve the security settings I've outlined, or are they unfeasible / unnecessary? My assumption is that if I use an 'ASPNET' user account, I'll lose the ability to distinguish between (for example) a Marketing department user, and a Finance department user, and that information may be useful if I develop more sensitive data pages in the future.
- How do I resolve the SQL Exception I'm generating?
Thank you for your time - I apologise for the length of the post, but I wanted to try to provide any relevant information.