<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>Security</title><link>http://forums.iis.net/1031.aspx</link><description>A forum aimed at helping understand IIS security such as Authentication, IP restrictions, and SSL</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: ASP.NET, Integrated Windows Authentication and Anonymous Access.</title><link>http://forums.iis.net/thread/1881703.aspx</link><pubDate>Fri, 10 Oct 2008 02:42:55 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1881703</guid><dc:creator>tokyoh</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1881703.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1031&amp;PostID=1881703</wfw:commentRss><description>&lt;p&gt;Excellent, thank you very much.&lt;/p&gt;
&lt;p&gt;So, I assume&amp;nbsp;the resultant identities of&amp;nbsp;HttpContext, WindowsIdentity and Thread ALL need permission on the website folder. &lt;/p&gt;</description></item><item><title>Re: ASP.NET, Integrated Windows Authentication and Anonymous Access.</title><link>http://forums.iis.net/thread/1881557.aspx</link><pubDate>Wed, 08 Oct 2008 13:19:19 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1881557</guid><dc:creator>tomkmvp</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1881557.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1031&amp;PostID=1881557</wfw:commentRss><description>&lt;p&gt;This should explain it:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa302377.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa302377.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The following tables illustrate, for a range of IIS authentication settings, the resultant identity that is obtained from each of the variables that maintain an &lt;b&gt;IPrincipal&lt;/b&gt; and/or &lt;b&gt;IIdentity&lt;/b&gt; object. The following abbreviations are used in the table: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;HttpContext&lt;/b&gt; = &lt;b&gt;HttpContext.Current.User&lt;/b&gt;, which&lt;b&gt; &lt;/b&gt;returns an &lt;b&gt;IPrincipal&lt;/b&gt; object that contains security information for the current Web request. This is the authenticated Web client. 
&lt;li&gt;&lt;b&gt;WindowsIdentity&lt;/b&gt; = &lt;b&gt;WindowsIdentity.GetCurrent()&lt;/b&gt;, which returns the identity of the security context of the currently executing Win32 thread. 
&lt;li&gt;&lt;b&gt;Thread&lt;/b&gt; = &lt;b&gt;Thread.CurrentPrincipal&lt;/b&gt; which returns the principal of the currently executing .NET thread which rides on top of the Win32 thread. &lt;/li&gt;&lt;/ul&gt;
&lt;blockquote class="dtBlock"&gt;&lt;b class="le"&gt;Note&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;With IIS 6.0 running on Windows Server 2003, the identity Matrix works except that the Machine\ASPNET identity is replaced with NT Authority\Network Service.&lt;/blockquote&gt;
&lt;p class="label"&gt;&lt;b&gt;Table 1. IIS anonymous authentication&lt;/b&gt;&lt;/p&gt;
&lt;div class="tablediv"&gt;
&lt;table class="dtTABLE" class="dtTABLE"&gt;

&lt;tr&gt;
&lt;th class=""&gt;Web.config Settings&lt;/th&gt;
&lt;th class=""&gt;Variable Location&lt;/th&gt;
&lt;th class=""&gt;Resultant Identity&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Windows&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;-&lt;br /&gt;MACHINE\IUSR_MACHINE&lt;br /&gt;-&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Windows&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;-&lt;br /&gt;MACHINE\ASPNET&lt;br /&gt;-&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Name provided by user&lt;br /&gt;MACHINE\IUSR_MACHINE&lt;br /&gt;Name provided by user&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Name provided by user&lt;br /&gt;MACHINE\ASPNET&lt;br /&gt;Name provided by user&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
&lt;p class="label"&gt;&lt;b&gt;Table 2. IIS basic authentication&lt;/b&gt;&lt;/p&gt;
&lt;div class="tablediv"&gt;
&lt;table class="dtTABLE" class="dtTABLE"&gt;

&lt;tr&gt;
&lt;th class=""&gt;Web.config Settings&lt;/th&gt;
&lt;th class=""&gt;Variable Location&lt;/th&gt;
&lt;th class=""&gt;Resultant Identity&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Windows&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Domain\UserName&lt;br /&gt;Domain\UserName&lt;br /&gt;Domain\UserName&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Windows&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Domain\UserName&lt;br /&gt;MACHINE\ASPNET&lt;br /&gt;Domain\UserName&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Name provided by user&lt;br /&gt;Domain\UserName&lt;br /&gt;Name provided by user&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Name provided by user&lt;br /&gt;MACHINE\ASPNET&lt;br /&gt;Name provided by user&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
&lt;p class="label"&gt;&lt;b&gt;Table 3. IIS digest authentication&lt;/b&gt;&lt;/p&gt;
&lt;div class="tablediv"&gt;
&lt;table class="dtTABLE" class="dtTABLE"&gt;

&lt;tr&gt;
&lt;th class=""&gt;Web.config Settings&lt;/th&gt;
&lt;th class=""&gt;Variable Location&lt;/th&gt;
&lt;th class=""&gt;Resultant Identity&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Windows&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Domain\UserName&lt;br /&gt;Domain\UserName&lt;br /&gt;Domain\UserName&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Windows&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Domain\UserName&lt;br /&gt;MACHINE\ASPNET&lt;br /&gt;Domain\UserName&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Name provided by user&lt;br /&gt;Domain\UserName&lt;br /&gt;Name provided by user&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Name provided by user&lt;br /&gt;MACHINE\ASPNET&lt;br /&gt;Name provided by user&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
&lt;p class="label"&gt;&lt;b&gt;Table 4: IIS integrated Windows&lt;/b&gt;&lt;/p&gt;
&lt;div class="tablediv"&gt;
&lt;table class="dtTABLE" class="dtTABLE"&gt;

&lt;tr&gt;
&lt;th class=""&gt;Web.config Settings&lt;/th&gt;
&lt;th class=""&gt;Variable Location&lt;/th&gt;
&lt;th class=""&gt;Resultant Identity&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Windows&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Domain\UserName&lt;br /&gt;Domain\UserName&lt;br /&gt;Domain\UserName&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Windows&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Domain\UserName&lt;br /&gt;MACHINE\ASPNET&lt;br /&gt;Domain\UserName&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext&lt;br /&gt;WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Name provided by user&lt;br /&gt;Domain\UserName&lt;br /&gt;Name provided by user&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;lt;identity impersonate=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot; /&amp;gt;&lt;/td&gt;
&lt;td class=""&gt;HttpContext. WindowsIdentity&lt;br /&gt;Thread&lt;/td&gt;
&lt;td class=""&gt;Name provided by user&lt;br /&gt;MACHINE\ASPNET&lt;br /&gt;Name provided by user&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;</description></item><item><title>Re: ASP.NET, Integrated Windows Authentication and Anonymous Access.</title><link>http://forums.iis.net/thread/1881515.aspx</link><pubDate>Wed, 08 Oct 2008 01:02:05 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1881515</guid><dc:creator>tokyoh</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1881515.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1031&amp;PostID=1881515</wfw:commentRss><description>&lt;p&gt;Right....&lt;/p&gt;
&lt;p&gt;What I was trying to do was somehow separate the authentication and authorization, so I could identify the user but still control the authorization with a single identity.&lt;br /&gt;Clearly impossible, right? An identity&amp;nbsp;is either a domain user or anon.&lt;/p&gt;
&lt;p&gt;But what about asp.net? With IWA enabled, I see this:&lt;/p&gt;
&lt;p&gt;System.Security.Principal.WindowsIdentity: NT AUTHORITY\NETWORK SERVICE&lt;br /&gt;HttpContext.Current.User: &lt;em&gt;Domain\username&lt;br /&gt;&lt;br /&gt;&lt;/em&gt;Here, the request&amp;nbsp;contains both&amp;nbsp;the worker process id and current user id. How do these relate to the ACL&amp;nbsp;on the website root? Which id is used for authorization?&lt;br /&gt;Sorry for these basic questions but I have to admit I just dont get it!&lt;/p&gt;</description></item><item><title>Re: ASP.NET, Integrated Windows Authentication and Anonymous Access.</title><link>http://forums.iis.net/thread/1881440.aspx</link><pubDate>Tue, 07 Oct 2008 12:35:02 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1881440</guid><dc:creator>tomkmvp</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1881440.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1031&amp;PostID=1881440</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m confused ...&amp;nbsp; 
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/iis/images/icon-quote.gif"&gt; &lt;strong&gt;tokyoh:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;I want to allow anonymous access to an asp.net&amp;nbsp;website but also authenticate the users&lt;/div&gt;&lt;/BLOCKQUOTE&gt;What do you mean exactly? For anonymous access, IUSR must have NTFS permissions to the files and folders.&amp;nbsp; For authenticated access, the domain users must have those permissions.&lt;/p&gt;</description></item><item><title>ASP.NET, Integrated Windows Authentication and Anonymous Access.</title><link>http://forums.iis.net/thread/1881425.aspx</link><pubDate>Tue, 07 Oct 2008 08:53:37 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1881425</guid><dc:creator>tokyoh</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1881425.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1031&amp;PostID=1881425</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;I want to allow anonymous access to an asp.net&amp;nbsp;website but also authenticate the users because some authorization is done by the web application. I want the web app to run under network service account and access to the website root be restricted to&amp;nbsp;the IIS_WPG&amp;nbsp;only.&lt;br /&gt;I am confused because although impersonation is not enabled, the domain users are denied access&amp;nbsp;unless added to the website root ACL. Surely, all requests should be using the network service account??&lt;/p&gt;
&lt;p&gt;Thanks for any help.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;This is my current setup:&lt;/p&gt;
&lt;p&gt;Windows 2003 R2 SP2&lt;/p&gt;
&lt;p&gt;ASP.NET 2.0 &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;The website is using the default application pool running under Network service account. &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;The IIS_WPG group has read and execute access on the website root.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;In web.config,&amp;nbsp;I have set authentication mode=&amp;quot;Windows&amp;quot; and impersonate = &amp;quot;false&amp;quot;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;IIS 6.0 &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Anonymous access enabled&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Integrated Windows Authentication enabled&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>