Re: SQL Server does not exist or access denied

From: Chris Jackson (chrisj_at_mvps.org)
Date: 08/29/03

  • Next message: Chris Jackson: "Re: how to get Windows logon credential?"
    Date: Fri, 29 Aug 2003 11:38:03 -0400
    
    

    When you use integrated authentication to connect to SQL Server, you
    authenticate using the credentials of the process you are running - in this
    case, aspnet_wp.exe. What you can do is set IIS to use a low-privileged
    domain account, turn on impersonation for asp.net (which you do in the
    web.config file), and then you will pass this over the wire. Without a
    domain account, you will have difficulties authenticating. Without turning
    on impersonation, you will find it difficult. Also, you don't include the
    user name and password in the connection string - this is for use with SQL
    authentication, not windows authentication.

    What is important to remember is that you have two processes here, not just
    one. IIS runs in one process space, and aspnet_wp in another, so you have to
    turn on impersonation to pick up what you have set in IIS. The full grid can
    be found here:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetAP05.asp

    -- 
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows XP
    Windows XP Associate Expert
    -- 
    "Ira W" <irawald@hotmail.com> wrote in message
    news:0e3c01c36d84$ee2ea1d0$a601280a@phx.gbl...
    > System worked great on development computer (IIS and SQL
    > on the same machine).
    >
    > Will not work in production environment (IIS and SQL on
    > separate
    > computers): "SQL Server does not exist or access denied."
    >
    > I know that this has been discussed many times.  I believe
    > I tried most of the suggestions - but I still can not get
    > to SQL Server.  I have spent so many hours trying to make
    > this work.  Ultra frustration.
    >
    > ON the IIS computer:
    > * User/password is defined on the computer for use by the
    > application.
    >
    > * Directory permissions set to permit access
    > - Temp folder set to read/write/delete
    > - winnt\microsoft.net\framework set to read only
    > - winnt\microsoft.net\framework\version\temporary asp.net
    > files set to read/write/delete
    >
    > * In IIS:
    > - Application installed in a virtual directory.
    > - IIS is set for anonymous access w/user and password
    > defined.
    >
    > * Root of virtual directory contains web.config.
    > - All access for database uses a connection string as
    > follows:
    >     integrated security=SSPI;data source=computer;persist
    > security
    > info=False;initial
    > catalog=database;uid=user;pwd=password;
    >
    > - Authentication set as forms based
    >
    > * In machine.config
    > - <processModel  ..  userName="user"
    > password="password"  ... />
    >
    >
    > On the sql server computer:
    > * exact same user/password is validated
    > * SQL server references the user.
    > * Database references the user.
    > * Permissions are set for relevant tables and procedures.
    >
    

  • Next message: Chris Jackson: "Re: how to get Windows logon credential?"

    Relevant Pages

    • Windows Authentication with IIS on separate machines
      ... Yes, setting Basic Authentication in IIS works, but the ... >in SQL server but doesn't work if user account was ... >imported from a Windows account. ...
      (microsoft.public.sqlserver.security)
    • Re: Authentication problem
      ... As matt notes below, even if nothing on your box has changed it's possible ... > On your IIS box, check the HTTP Authentication tab of the SQL Server ...
      (microsoft.public.sqlserver.ce)
    • IIS vs ASP.Net Authentication problem
      ... Requirement is to use 'domain\iisuser' to authenticate in SQL Server ... Only Integrated Windows Authentication enabled (Anonymous/basic/digest ... unchecked) in IIS 5 ... Login failed for user 'CCMIWS05\ASPNET'. ...
      (microsoft.public.dotnet.security)
    • RE: Interdev not creating project (authenticate failure)
      ... | 1st Computer (for SQL Server and IIS): ... | Member of: Administrators ... Also in IIS console, rightclick the web site and go to properties/directory ... Integrated Windows and check Basic authentication. ...
      (microsoft.public.inetserver.iis.security)
    • Re: Windows Authentication in asp.net 2005 to SQL Server?
      ... If the domains do not trust each other, Windows authentication is not going ... Basic authentication sometimes makes the need for Kerberos delegation go ... generic account to do the backend data stuff on our SQL Server. ...
      (microsoft.public.dotnet.framework.aspnet.security)