Windows Authentication with IIS on separate machines

From: Brian Harshenin (bharshen@hha.ab.ca)
Date: 11/20/02


From: "Brian Harshenin" <bharshen@hha.ab.ca>
Date: Wed, 20 Nov 2002 14:17:58 -0800


Hi Recardo
I'm having the same problem but I think I have figured it
out...at least this works for me
This is what I have setup:
Win2000 - IIS 5
-Web Application is using Basic Authentication set in IIS
-Added user account TESTUSER and gave read access to
directory where web app files reside

Win2000 - SQL 2000
- added TESTUSER with same password
- in MMC added Security Templates Snap in
- ensured Log on Locally was set for users
Console Root -> Security Templates->Setup Security->Local
Policies -> User Rights Assignment ->Log on locally

My connection string was passing the username and
password to SQL server. This works if the user is created
in SQL server but doesn't work if user account was
imported from a Windows account.

objDC.Open "Provider=MSDASQL.1;DRIVER={SQL Server};
SERVER=xxx.xxx.xxx.xxx;DATABASE=Pubs;UID=TESTUSER;PWD=pwor
d;Network Library=DBMSSOCN;"

I removed UID and PWD in order to authenticate to the
Windows account, now my data connection authenticates
under all my imported windows accounts. If I monitor this
in Computer Management -> Shared Folders -> Sessions I
can see the users open sessions and queries...so I'm
assuming this is working the way I want it to.

For the accounts that were created in SQL Server, it
tries to login as 'MYDB\Guest'.. (Guest SHOULD be
disabled in the fist place)!

Microsoft OLE DB Provider for ODBC Drivers
error '80040e4d'
[Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'MYDB\Guest'.

Check out this KB article as well
http://support.microsoft.com/default.aspx?scid=KB;EN-
US;247931

Ultimately you would want to centrally manage the users
instead of adding the same account on multiple servers.
Drop me an email if you wish to discuss this.
Regards
B

>-----Original Message-----
>Hi,
>
>We're trying to make our Intranet pages use Sql Server
>Windows Authentication. We're using Windows 2000, with
SQL
>Server on one machine and the IIS on another.
>
>That only works when the user logs on the IIS Server,
>otherwise we're receiving the error:
>Microsoft OLE DB Provider for SQL Server
error '80040e4d'
>
>Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
>
>When SQL and IIS are on the same machine everything ok.
>
>Thanks in advance.
>
>
>
>.
>



Relevant Pages

  • Re: Kerberos from XP to IIS hosting ASP.NET 2.0 Web Service help
    ... If your MS SQL Server is running under a custom /local/ account, ... not sure how Kerberos authentication is supposed to work. ... If SQL Server is running under a domain account, ... you are not authenticating to IIS as anonymous. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Trusted sql connection failure
    ... Is the SQL Server located on a different machine to the IIS webserver? ... you probably need to run ASP.NET under a domain account (or find some ... it appears that you are running ASP.NET under a local account (either ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: IUsr can not login
    ... I too am not sure what the IIS lockdown tool does (I am a SQL Server ... that had been assigned permission to login into SQL ... Amongst the NT account names will be the account/group that IIS ...
    (microsoft.public.sqlserver.security)
  • Re: Login failed for user NT AUTHORITYANONYMOUS LOGON
    ... You can find the account that the web app is running under by looking in the ... 'Identity' tab of the relevant 'Application Pool' within IIS 6. ... > a) The Web server is on a seperate box to SQL Server. ... > c) I've enabled anonymous access, setting it to the correct domain ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: custom page for user credentials?
    ... With "no impersonation of IIS" I mean: the application should use the same ... windows account for all users. ... the user enters at the client side match a specific windows account - and I ... So I've implemented an additional "login provider" - ...
    (microsoft.public.inetserver.iis.security)