Troubles with Security Model - Advice Needed Please

From: Joe (Joe_at_Joe.com)
Date: 03/18/04


Date: Wed, 17 Mar 2004 16:09:21 -0700

I'm having trouble with my security model, and I was hoping I could find some help.

My ASP.NET app (that uses RS) is going to be running in an intranet environment. So, to develop and test it, I have installed everything locally (i.e., IIS, RS, SQL Server, VS .NET 2003) on my Win2k Server.

In IIS, I have disabled anonymous access so that only Integrated Windows authentication is used. Then in my Web.config file I've set it up to use Windows authentication, as such:

  <appSettings>
    <add key="connectionString" value="database=DatabaseName;Integrated Security=SSPI;server=localhost;Trusted_Connection=true" />
  </appSettings>

  <system.web>
    <authentication mode="Windows" />
    <authorization>
      <deny users="?" />
    </authorization>
    <identity impersonate="true" />
  </system.web>

When I try to access a database (installed on localhost), I get the following error:

System.Data.SqlClient.SqlException: Cannot open database requested in login 'DatabaseName'. Login fails. Login failed for user 'MACHINENAME\ASPNET'.

It's as if it is using the default ASP.NET worker process account (which is not what I want). I need it to authenticate me as my logged in user (which has access to the database).

One more piece of info., if I check the user identity by calling HttpContext.Current.User.Identity.Name, it is correct.

So, my questions are: what am I doing wrong? how do I set up IIS, Web.config, database connection, etc. so that everything is properly authenticated to the logged in user?

Thanks in advance for your help.



Relevant Pages

  • RE: cannot view web pages after transferring files to web server
    ... Integrated Windows authentication. ... What we want is - if a logged-in Windows user has database rights, ... asp.net in-built development server. ... However, when I copy this website to a virtual directory on an IIS server, I ...
    (microsoft.public.dotnet.framework.aspnet)
  • Login failure from asp.net delegation
    ... We want to use windows 2000 User auth to query sql 2000 using security ... checked "Integrated Windows Auth" in IIS and have added this to web.config. ... I have not added a login to the database since i thought it passes in the ...
    (microsoft.public.sqlserver.security)
  • Windows Authentication Problem
    ... I am trying to set up an intranet site with windows authentication. ... Database. ... [Win 2003 Server Domain] ... In case I had set this group up incorrectly, I decided to add a Login ...
    (microsoft.public.sqlserver.security)
  • Windows Authentication Problem
    ... I am trying to set up an intranet site with windows authentication. ... Database. ... [Win 2003 Server Domain] ... In case I had set this group up incorrectly, I decided to add a Login ...
    (microsoft.public.sqlserver.connect)
  • Database Login Fail - Weird Problem
    ... "Cannot open database requested in login ... I have ASPNET setup as the user in IIS, identity impersonate is true in the ...
    (microsoft.public.dotnet.framework.aspnet)