ASP.NET (IIS 6.0) Windows authentication/SQL Server problem

N

Nick Gilbert

Hi,

On Windows 2000, I use the following connection string in my ASP.NET
applications:

<add key="ConnectionString" value="server=(local);Integrated
Security=SSPI;database=knowledge" />

I then created a login in SQL Server for the ASPNET/<machine name> user and
assigned it to a WWWUsers role. This meant that SQL Server automatically
made requests from the website under the WWWUsers role. In IIS, I then
removed anonymous access from the /admin/ folder on the website, which then
caused IE to prompt for a username and password. If I logged in as
'webadmin' and a webadmin login had been created on SQL Server for that
database in the WWWAdmins role, then it would automatically run website
queries by administrators under the WWWAdmins role.

*HOWEVER*, under Windows 2003 Server (IIS6), this seems to be broken. It
either doesn't prompt for a username and password, or if it does, it seems
to ignore it completely and SQL Server still puts me in the WWWUsers role. I
have put the NETWORK AUTHORITY/NETWORK SERVICE user in the WWWUsers role,
and the webadmin user (a valid Windows account) is still in the WWWAdmins
role.

Why is IIS 6 not behaving the same way as IIS 5.5 on Windows 2000? Have I
made a mistake somewhere or is there a way to make it work in the same way
as Windows 2000?

Thanks,

Nick Gilbert
 
N

Nick Gilbert

I think I've fixed it...

I was using Forms Authentication for the main site users, so I didn't want
to break that by putting in the <identity impersonate="true" /> tag in
web.config, but then I realised I can turn on impersonation just for the
admin folder and now it seems to be working OK with this in the web.config:

<location path="/admin">
<system.web>
<identity impersonate="true" />
</system.web>
</location>

Nick...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top