RE: Problem setting authentication modes on files under a virtual directory

From: Mike Moore [MS] (michmo@online.microsoft.com)
Date: 10/31/02


From: michmo@online.microsoft.com ("Mike Moore [MS]")
Date: Thu, 31 Oct 2002 01:27:38 GMT


Hi joel,

I must apologize. I forwarded your question to the attention of the wrong
person. We just got it straightened out, but it still may not be until
Friday when someone posts a technical response. My apologies again.

Thank you, Mike Moore
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.

--------------------
>Content-Class: urn:content-classes:message
>From: "Joel Zhou" <joel.zhou@emersonprocess.com>
>Sender: "Joel Zhou" <joel.zhou@emersonprocess.com>
>Subject: Problem setting authentication modes on files under a virtual
directory
>Date: Mon, 28 Oct 2002 11:36:39 -0800
>Lines: 31
>Message-ID: <10c2301c27eb9$55c4de10$2ae2c90a@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Thread-Index: AcJ+uVXEYH/CH2xSSOS4XucHGe+P5A==
>Newsgroups: microsoft.public.dotnet.framework.aspnet.security
>Path: cpmsftngxa09
>Xref: cpmsftngxa09 microsoft.public.dotnet.framework.aspnet.security:2741
>NNTP-Posting-Host: TKMSFTNGXA14 10.201.226.42
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
>
>Our web project needs to set all .aspx pages to use Basic
>authentication, and all .asmx pages to use Windows
>authentication (NTLM).
>
>When I try to use DirectoryEntry in
>System.DirectoryServices, I was not able to change the
>authentication mode of a file at the root level of a
>virtual directory. However, I was able to change the
>authentication mode of a file that is under a web
>directory in a virtual directory.
>
>For example, doing the following will throw an
>COMException : "System cannot find the path specified".
>String iisPath
>= "IIS://localhost/W3SVC/1/Root/Email/Service1.asmx");
>DirectoryEntry webService = new DirectoryEntry( iisPath ) ;
>webService.Properties["AuthNTLM"][0] = true;
>
>If I create a web directory under Email virtual directory,
>and open a web service file there, I was then able to set
>the authentication.
>String iisPath
>= "IIS://localhost/W3SVC/1/Root/Email/NewDir/Service1.asmx"
>);
>DirectoryEntry webService = new DirectoryEntry( iisPath ) ;
>webService.Properties["AuthNTLM"][0] = true;
>
>Any suggestions?
>
>Thanks,
>Joel
>