<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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/"><channel><title>Care, Share and Grow! : Kerberos</title><link>http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx</link><description>Tags: Kerberos</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>New features in SETSPN.EXE on Windows Server 2008</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/01/09/new-features-in-setspn-exe-on-windows-server-2008.aspx</link><pubDate>Fri, 09 Jan 2009 03:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9300964</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9300964.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9300964</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9300964</wfw:comment><description>&lt;P&gt;The version of Setspn.exe that came with Microsoft Windows Server 2000/2003 Support Tools did not have features to detect duplicate SPNs. The new version of Setspn.exe that comes bundled with Windows Server 2008 utilities has some really cool features. For someone dealing with the dreaded Kerberos authentication failure issues on a daily basis like me it's a sigh of relief.&lt;/P&gt;
&lt;P&gt;If you try the following command on the Windows Server 2008 you will see the various new options (or switches) available.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Refreshingfeature.EXEONWindowsServer2008_6D9/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Refreshingfeature.EXEONWindowsServer2008_6D9/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=450 alt=image src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Refreshingfeature.EXEONWindowsServer2008_6D9/image_thumb.png" width=664 border=0 mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Refreshingfeature.EXEONWindowsServer2008_6D9/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Notice the modifiers/switches:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-F = perform the duplicate checking on forestwide level&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-S = add arbitrary SPN after verifying no duplicates exist&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-Q = query for existence of SPN&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-X = search for duplicate SPNs&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Searching for duplicate SPNs using Setspn.exe:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 74.96%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 125px; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;D:\&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;setspn -X http/www.test.com
Processing entry 0
http/www.test.com is registered on these accounts:
    CN=mstest,CN=Users,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    CN=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,OU=Domain Controllers,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 

found 1 group of duplicate SPNs.
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;Searching for the existence of an SPN in the domain:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 75.15%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 205px; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;D:\&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;setspn -Q http/www.test.com
CN=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,OU=Domain Controllers,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com
    ldap/2334590-45566-113f....
    HOST/&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    HOST/&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;.&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    .......
    .......
CN=mstest,CN=Users,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com 

Existing SPN found!
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;Adding an arbitrary SPN after verifying no duplicates exist in the domain: 
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 74.96%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 109px; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;D:\&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;setspn -S http/www.test.com &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
CN=mstest,CN=Users,.&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;.&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com 

Duplicate SPN found, aborting operation!

&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;Adding an arbitrary SPN after verifying no duplicates exist in the forest: 
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 75.15%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 141px; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;D:\&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;setspn -F -S http/www.test.com &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
Operation will be performed forestwide, it might take a while.
CN=mstest,CN=Users,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com
CN=mstest1,CN=Users,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com 

Duplicate SPN found, aborting operation! 
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;So what does this mean? It means you no longer have to depend upon boggling commands using LDIFDE or your own custom scripts to find out the duplicate SPNs. This is a good news indeed!&lt;/P&gt;
&lt;P&gt;*Prior to this using Windows Server 2000/2003 Support Tools we could use commands using LDIFDE to find duplicate SPNs as below:&lt;/P&gt;
&lt;P&gt;Syntax:&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 85.36%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; HEIGHT: 49px; BACKGROUND-COLOR: #f4f4f4"&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;ldifde -f &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; -d "&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;dc&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #ff0000"&gt;domain-netbiosname&lt;/SPAN&gt;,&lt;SPAN style="COLOR: #ff0000"&gt;dc&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #ff0000"&gt;primary-domain&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;" -l serviceprincipalname -r "(serviceprincipalname=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;serviceprincipalname-to-check-for-duplicates&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)" -p subtree&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;For example, if the domain name is test.abcd.com and the site URL is http//test.abcd.com command should be as shown below: &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 85.25%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; HEIGHT: 39px; BACKGROUND-COLOR: #f4f4f4"&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;ldifde –f C:\log.txt -d "dc=test, dc=abcd, dc=com"-l serviceprincipalname –r "(serviceprinicpalname=http/test.abcd.com)" -p subtree&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;With the newer version of Setspn hopefully the dependency on the above command should reduce drastically.&lt;/P&gt;
&lt;P&gt;Till next time,&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9300964" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setspn/default.aspx">Setspn</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category></item><item><title>Service Principal Name (SPN) checklist for Kerberos authentication with IIS 7.0</title><link>http://blogs.msdn.com/saurabh_singh/archive/2008/12/25/service-principal-name-spn-checklist-for-kerberos-authentication-with-iis-7-0.aspx</link><pubDate>Thu, 25 Dec 2008 04:01:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9252291</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9252291.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9252291</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9252291</wfw:comment><description>&lt;p&gt;In continuation to one of my earlier &lt;a href="http://blogs.msdn.com/saurabh_singh/archive/2007/01/29/kerberos-troubleshooting-from-iis-perspective.aspx" target="_blank"&gt;posts&lt;/a&gt; which focused on IIS 6.0 this post is more about the confusion that may arise around SPNs for setting up Kerberos authentication in IIS 7.0. IIS 7.0 has a new Kernel-mode authentication feature using which the ticket for the requested service is decrypted using Machine account (Local system) of the IIS server. It no longer depends upon the application pool Identity for this purpose by default and in turn improves the performance.  &lt;p&gt;Here is how it looks like.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/KerberostroubleshootingfromIISperspect.0_7F3B/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="207" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/KerberostroubleshootingfromIISperspect.0_7F3B/image_thumb.png" width="534" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/KerberostroubleshootingfromIISperspect.0_7F3B/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="306" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/KerberostroubleshootingfromIISperspect.0_7F3B/image_thumb_1.png" width="456" border="0"&gt;&lt;/a&gt;  &lt;p&gt;So what does this mean?  &lt;p&gt;You no longer need to worry about the correlation between HTTP SPNs and the Application pool Identity that was required in the earlier version i.e. IIS 6.0. But that's not blindly true. There has been some confusion whether we don't have to care at all about SPNs or may have to depending upon the settings. Here is a checklist to give more clarity for different scenarios that you may fall under:  &lt;p&gt;&lt;strong&gt;SCENARIO 1a&lt;/strong&gt;&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;IIS 7.0 Web Site/Application&lt;/td&gt; &lt;td valign="top" width="469"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Integrated Windows authentication&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Application Pool Identity&lt;/td&gt; &lt;td valign="top" width="469"&gt;NETWORK SERVICE&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Kernel-Mode authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Enabled (&amp;lt;attribute name="useKernelMode" type="bool" defaultValue="true" /&amp;gt; in the ApplicationHost.config file)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Site URL&lt;/td&gt; &lt;td valign="top" width="469"&gt;Accessed with the NetBIOS name, like &lt;font size="1"&gt;http://&lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt;/Default.aspx&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;SPNs will be required ONLY for the IIS machine account: &lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="674"&gt;HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="674"&gt;HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;.fully-qualified-domainname&amp;gt; for e.g. HOST/myIISserver.mydomain.com&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#804000"&gt;&lt;strong&gt;***Note&lt;/strong&gt;: By default HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; and HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;.fully-qualified-name&amp;gt; is already added for the machine account when a machine is added to a domain and HTTP forms a part of HOST. So you may not have to do anything special here for SPNs. Everything should be set by default.&lt;/font&gt;&lt;/em&gt;  &lt;p&gt;You can check the set of existing SPNs for the machine account by running the following command:  &lt;p&gt;&amp;gt; Setspn.exe -L &lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt; or directly using a Snap-in like &lt;a href="http://technet.microsoft.com/en-us/library/cc773354.aspx" target="_blank"&gt;Adsiedit.msc&lt;/a&gt;.  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp; &lt;p&gt;&lt;strong&gt;SCENARIO 1b&lt;/strong&gt;&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;IIS 7.0 Web Site/Application&lt;/td&gt; &lt;td valign="top" width="469"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Integrated Windows authentication&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Application Pool Identity&lt;/td&gt; &lt;td valign="top" width="469"&gt;Custom account for e.g. Domain1\Username1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Kernel-Mode authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Enabled (&amp;lt;attribute name="useKernelMode" type="bool" defaultValue="true" /&amp;gt; in the ApplicationHost.config file)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Site URL&lt;/td&gt; &lt;td valign="top" width="469"&gt;Accessed with the NetBIOS name, like &lt;font size="1"&gt;http://&lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt;/Default.aspx&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;The SPN requirements remain the same as above. You don't have to add SPNs like http/&lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt; for the Domain1\Username1 unlike in IIS 6.0 (where we had to add an SPN of the form http/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; for the Application Pool identity). &lt;/p&gt; &lt;p&gt;SPNs will be required ONLY for the IIS machine account:&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="674"&gt;HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="674"&gt;HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;.fully-qualified-domainname&amp;gt; for e.g. HOST/myIISserver.mydomain.com&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#804000"&gt;&lt;strong&gt;***Note&lt;/strong&gt;: By default HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; and HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;.fully-qualified-name&amp;gt; is already added for the machine account when a machine is added to a domain and HTTP forms a part of HOST. So you may not have to do anything special here for SPNs. Everything should be set by default.&lt;/font&gt;&lt;/em&gt;  &lt;p&gt;You can check the set of existing SPNs for the machine account by running the following command:  &lt;p&gt;&amp;gt; Setspn.exe -L &lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt; or directly using Snap-in like &lt;a href="http://technet.microsoft.com/en-us/library/cc773354.aspx" target="_blank"&gt;Adsiedit.msc&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SCENARIO 2a&lt;/strong&gt;&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;IIS 7.0 Web Site/Application&lt;/td&gt; &lt;td valign="top" width="469"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Integrated Windows authentication&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Application Pool Identity&lt;/td&gt; &lt;td valign="top" width="469"&gt;NETWORK SERVICE&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Kernel-Mode authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Enabled (&amp;lt;attribute name="useKernelMode" type="bool" defaultValue="true" /&amp;gt; in the ApplicationHost.config file)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Site URL&lt;/td&gt; &lt;td valign="top" width="469"&gt;Accessed with a Custom Host name, like &lt;font size="1"&gt;http://&lt;em&gt;www.mysite.com&lt;/em&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br&gt;SPNs will be required ONLY for the &lt;em&gt;IIS machine account&lt;/em&gt; in the following format: &lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="400" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="400"&gt;HTTP/&lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt; for e.g. HTTP/&lt;em&gt;www.mysite.com&lt;/em&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;You can add an SPN using Setspn.exe like  &lt;p&gt;&amp;gt; Setspn -a &lt;strong&gt;http/&lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/strong&gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;where &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; is the IIS machine account and &lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt; is the custom host/host header name for the Web Site URL.&lt;/p&gt; &lt;p&gt;e.g. &amp;gt; Setspn -a http/www.mysite.com &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&amp;gt;&lt;/em&gt;&lt;br&gt;&lt;font size="1"&gt;*The command is NOT case sensitive&lt;/font&gt; &lt;/p&gt; &lt;p&gt;You can check the existing set of SPNs for the machine account by running the following command:  &lt;p&gt;&amp;gt; Setspn.exe -L &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;  &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;strong&gt;SCENARIO 2b&lt;/strong&gt;&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;IIS 7.0 Web Site/Application&lt;/td&gt; &lt;td valign="top" width="469"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Integrated Windows authentication&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Application Pool Identity&lt;/td&gt; &lt;td valign="top" width="469"&gt;Custom account for e.g. Domain1\Username1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Kernel-Mode authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Enabled (&amp;lt;attribute name="useKernelMode" type="bool" defaultValue="true" /&amp;gt; in the ApplicationHost.config file)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Site URL&lt;/td&gt; &lt;td valign="top" width="469"&gt;Accessed with a Custom host/Host header name, like &lt;font size="1"&gt;http://&lt;em&gt;www.mysite.com&lt;/em&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;br&gt;SPNs will be required ONLY for the IIS machine account and NOT for Domain1\Username1 account unlike in IIS 6.0.&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="400" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="400"&gt;HTTP/&lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt; for e.g. HTTP/&lt;em&gt;www.mysite.com&lt;/em&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;You can add an SPN using Setspn.exe like  &lt;p&gt;&amp;gt; Setspn -a &lt;strong&gt;&lt;em&gt;http/&amp;lt;site-custom-name&amp;gt;&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/strong&gt; where &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; is the IIS machine account and &lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt; is the custom host/host header name for the Web Site URL.&lt;/p&gt; &lt;p&gt;e.g. &amp;gt; Setspn -a http/www.mysite.com &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&amp;gt;&lt;/em&gt;&lt;br&gt;&lt;font size="1"&gt;*The command is NOT case sensitive&lt;/font&gt;&amp;nbsp;&amp;nbsp; &lt;/p&gt; &lt;p&gt;You can check the existing set of SPNs for the machine account by running the following command:  &lt;p&gt;&amp;gt; Setspn.exe -L &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;  &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;font size="4"&gt;&lt;strong&gt;Special case of running IIS 7.0 in a WEB FARM&lt;/strong&gt;&lt;br&gt;&lt;/font&gt;&lt;br&gt;If you are running IIS 7.0 server in a Web farm the KDC will not know in advance which individual server the request may go to and hence ticket decryption may fail. Hence in such a scenario instead of registering SPNs under a specific machine account use a domain account. I am not a SharePoint guy but based on what I have read on the Web this scenario is also applicable to a single SharePoint server configuration.&lt;br&gt;&lt;/p&gt; &lt;p&gt;There are two ways to go:&lt;/p&gt; &lt;p&gt;Either &lt;/p&gt; &lt;p&gt;Disable Kernel mode authentication and follow the general steps for Kerberos as in the previous IIS 6.0 version. Refer &lt;a href="http://support.microsoft.com/kb/871179" target="_blank"&gt;this&lt;/a&gt;.&amp;nbsp; &lt;p&gt;Or,  &lt;p&gt;[Recommended for Performance reasons]  &lt;p&gt;Let Kernel mode authentication be enabled and the Application pool's identity be used for Kerberos ticket decryption. The only thing you need to do here is:  &lt;p&gt;1. Run the Application pool under a common custom domain account.  &lt;p&gt;2. Add this attribute "useAppPoolCredentials" in the ApplicationHost.config file.  &lt;p&gt;&amp;lt;system.webServer&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;lt;security&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;authentication&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;windowsAuthentication enabled="true" useKernelMode="true" &lt;strong&gt;useAppPoolCredentials="true"&lt;/strong&gt; /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/authentication&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/security&amp;gt;&lt;br&gt;&amp;lt;/system.webServer&amp;gt;  &lt;p&gt;Remember there is no GUI setting for this. You need to modify the ApplicationHost.config file from  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&amp;lt;%SystemDrive%&amp;gt;/Windows/System32/inetsrv/config&lt;/u&gt;&lt;/strong&gt; folder on the IIS 7.0 machine.  &lt;p&gt;3. Add the SPNs in the form:  &lt;p&gt;&lt;em&gt;http/&amp;lt;virtualhost-name&amp;gt;&lt;/em&gt; and  &lt;p&gt;&lt;em&gt;http/&amp;lt;virtualhost-name.fully-qualified-name&amp;gt;&lt;/em&gt;&amp;nbsp; for the Application Pool Identity.  &lt;p&gt;Ensure that we don't have such an entry for SPNs for any other account including IIS server machine account.  &lt;p&gt;***If we have the same SPN mapped to multiple accounts (be it a machine or an user account) it leads to Duplicate SPNs and will break Kerberos.  &lt;p&gt;Hope this helps!  &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9252291" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Authentication/default.aspx">Authentication</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS+7.0/default.aspx">IIS 7.0</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setup/default.aspx">Setup</category></item><item><title>Who knows! You may be missing these points for Kerberos authentication failures for Web applications...</title><link>http://blogs.msdn.com/saurabh_singh/archive/2008/11/16/who-knows-you-may-be-missing-these-points-for-kerberos-authentication-failures-for-web-applications.aspx</link><pubDate>Sun, 16 Nov 2008 13:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9102793</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9102793.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9102793</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9102793</wfw:comment><description>&lt;p&gt;I am sharing here some of the general + elusive + ignored + must-have info that you may want to recheck when you are troubleshooting a kerberos cum delegation failure scenario and feel like reaching nowhere near the end of the tunnel (resolution!). These are my personal checklists based on experiences of troubleshooting kerberos related &lt;a href="http://encarta.msn.com/dictionary_1861614754/gotcha.html" target="_blank" mce_href="http://encarta.msn.com/dictionary_1861614754/gotcha.html"&gt;gotchas&lt;/a&gt;. I had also posted my first article on troubleshooting kerberos issues way back in January 2007. This article is a kind of continuation to it since I still see a lot of people missing some finer points here and there. Please check this &lt;a href="http://blogs.msdn.com/saurabh_singh/archive/2007/01/29/kerberos-troubleshooting-from-iis-perspective.aspx" target="_blank" mce_href="http://blogs.msdn.com/saurabh_singh/archive/2007/01/29/kerberos-troubleshooting-from-iis-perspective.aspx"&gt;post&lt;/a&gt; for the general kerberos checklist.&lt;/p&gt;
&lt;p&gt;So here I go...&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kerberos was designed and is supported in Intranet scenarios. If you are trying to make it work over an Internet environment you may want to recheck other options (unless you are going ahead with Protocol transition for e.g. from Basic/NTLM to kerberos). Remember that for kerberos to work, the client (e.g. client browser) should be able to connect to the Domain Controller(KDC) to acquire the tickets. If your clients are coming over the Internet they may not be having access to the Domain Controller. Most security conscious organizations keep their DC away from Internet facing network in order to reduce the likelihood of it getting compromised. You may have to check with the firewall/proxy settings etc. and more...to make this work which I personally feel is not a good idea.&lt;/li&gt;&lt;/ul&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kerberos will work for resources (client-IIS-Backend DB etc.) in the same domain or in trusted domains within the same forest. Either have mutual trust (preferable) between the domains in the forest or at least have the IIS domain trust the client's domain. If your clients are coming from a domain across the forest with an external trust we need to do extra work. Refer to this &lt;a href="http://technet.microsoft.com/en-us/library/bb877995.aspx" target="_blank" mce_href="http://technet.microsoft.com/en-us/library/bb877995.aspx"&gt;article&lt;/a&gt;. I am not an AD guy &lt;img src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/red_smile.gif" alt="Embarrassed" mce_src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/red_smile.gif"&gt;.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Here is an excerpt from the same article:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;&lt;font color="#804040"&gt;The Windows Server 2003 family supports domain trusts and forest trusts. We know what domain trusts are: they allow a user to authenticate to resources in another domain. Like always, all domain trust relationships have only two domains in the relationship: the trusting domain and the trusted domain. There are one-way trusts (unidirectional) and two-way trusts (bi-directional) and a Windows Server 2003 domain can establish a trust among other Windows 2000/2003 domains in the same or different forest, Windows NT 4.0 domains and Kerberos V5 realms. In Windows 2000, if users in one forest needed access to resources in a second forest, an administrator could create an external trust relationship between the two domains, which is one-way and non-transitive. This meant that in order to extend your trust to other domains in the forests you had to explicitly configure each and every one of them. &lt;/font&gt;&lt;/i&gt;
&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;font color="#804040"&gt;Windows Server 2003 offers a forest trust: two-way Kerberos-based transitive trust between Windows Server 2003 forests, enabling a transitive trust between all the domains in the two forests. Forest trusts are established between the root domain of both forests and can be either one way or two way. A Few things to remember are to make sure all domain controllers in both forests are running Windows Server 2003, with a correctly configured DNS infrastructure and forest functionality level set to Windows Server 2003 mode in both forests. &lt;/font&gt;&lt;/i&gt;
&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;font color="#804040"&gt;&lt;/font&gt;&lt;/i&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Many a times you will see something as shown below when connecting to a web site over Windows integrated authentication. You may have checked all the basic settings for kerberos and things look okay, yet somehow mysteriously this is failing to work with kerberos. After three attempts it will fail with 401.&lt;/li&gt;&lt;/ul&gt;
&lt;p align="justify"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You typed in &lt;b&gt;&lt;i&gt;&lt;u&gt;http://www.test.com&lt;/u&gt;&lt;/i&gt;&lt;/b&gt; in the browser and it seems to be connecting to some other machine&amp;nbsp;&amp;nbsp; name&amp;nbsp; as&amp;nbsp; shown below in the picture.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/2e48434f7ed2_14212/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/2e48434f7ed2_14212/image_8.png"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/2e48434f7ed2_14212/image_thumb_3.png" style="border-width: 0px;" alt="image" mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/2e48434f7ed2_14212/image_thumb_3.png" width="472" border="0" height="434"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Look at the IE prompt which shows that we are trying to connect to testkrb.saurabh1.com although web site URL in the browser's address box shows we are trying to reach the site &lt;b&gt;&lt;i&gt;www.test.com&lt;/i&gt;&lt;/b&gt;. Ideally we should have seen "Connecting to www.test.com" and not "connecting to testkrb.saurabh1.com". Equivalently try a ping to &lt;b&gt;&lt;i&gt;www.test.com&lt;/i&gt;&lt;/b&gt; and see what it resolves to.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/2e48434f7ed2_14212/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/2e48434f7ed2_14212/image_6.png"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/2e48434f7ed2_14212/image_thumb_2.png" style="border-width: 0px;" alt="image" mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/2e48434f7ed2_14212/image_thumb_2.png" width="507" border="0" height="108"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you see such a scenario it's time to check whether the web site URL is an Alias(CNAME) or a DNS Host (A) Record. There is a known issue with using Alias for a site which may not allow kerberos to work. There are some details which I don't want to get into at this point, probably some other day. In short, it tries to look into the KDC based on the SPN &lt;b&gt;&lt;i&gt;http/testkrb.saurabh1.com&lt;/i&gt;&lt;/b&gt; and not an SPN of the form &lt;b&gt;&lt;i&gt;http/www.test.com&lt;/i&gt;&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;Solution: &lt;/p&gt;
&lt;p&gt;Server side: Either go ahead and change the DNS entry to add &lt;b&gt;&lt;i&gt;www.test.com&lt;/i&gt;&lt;/b&gt; as a DNS Host (A) Record and not CNAME.&lt;/p&gt;
&lt;p&gt;or, &lt;/p&gt;
&lt;p&gt;Client side: Apply this &lt;a href="http://support.microsoft.com/kb/911149" target="_blank" mce_href="http://support.microsoft.com/kb/911149"&gt;hotfix&lt;/a&gt; to IE browser on the client(s) (I don't see this as a good option).&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I would recommended to use a host name instead of an IP address to access a web site meant for a kerberos based authentication. You may see it working just fine even with IP address in some scenarios but then it may pose problems when we have client and servers in different domains etc. You may get into an issue wherein domain2 will not give any referral back to to the client to look into domain1 for the SPN. This can occur if IP address is being used to look for a service. In such a case even after adding SPN's for IP addresses, Kerberos won't work and will fall back to NTLM.&lt;/li&gt;&lt;/ul&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If your web site is configured to use a non-default HTTP port like 81 instead of 80, users will access the site as &lt;b&gt;&lt;i&gt;&lt;u&gt;http://www.test.com:81&lt;/u&gt;&lt;/i&gt;&lt;/b&gt; and not &lt;b&gt;&lt;i&gt;&lt;u&gt;http://www.test.com&lt;/u&gt;&lt;/i&gt;&lt;/b&gt; (browsers append ':80' as the default port if none specified). Here lies the confusion when you add SPNs for the web site. Don't have an SPN with the port number appended even if you are running your site on a non-default port.&lt;/li&gt;&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;If the site is accessed as &lt;u&gt;&lt;b&gt;&lt;i&gt;http://&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i&gt;www.test.com:8&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i&gt;080&lt;/i&gt;&lt;/b&gt;&lt;/u&gt; SPN will still be of the form &lt;b&gt;&lt;i&gt;http/www.test.com&lt;/i&gt;&lt;/b&gt;&amp;nbsp; and&amp;nbsp; not &lt;b&gt;&lt;i&gt;http/www.test.com:8080&lt;/i&gt;&lt;/b&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Refer to this &lt;a href="http://technet.microsoft.com/en-us/library/cc263449.aspx#section4" target="_blank" mce_href="http://technet.microsoft.com/en-us/library/cc263449.aspx#section4"&gt;article&lt;/a&gt;. It confuses me further but I would suggest go ahead with the default as above.&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Consider a scenario wherein two applications &lt;i&gt;&lt;b&gt;&lt;u&gt;http://servername/app1&lt;/u&gt;&lt;/b&gt;&lt;/i&gt; and &lt;b&gt;&lt;i&gt;&lt;u&gt;http://servername/app2&lt;/u&gt;&lt;/i&gt;&lt;/b&gt; are running under a NETWORK SERVICE &amp;amp; a domain user Application Pool identities respectively .&lt;br&gt;The SPNs requested will be &lt;i&gt;&lt;b&gt;http/servername&lt;/b&gt;&lt;/i&gt; in both the cases, and since we can’t have duplicate SPNs; kerberos&amp;nbsp;may not&amp;nbsp;work for either of the applications. We need to then either use the same Application Pool identity or separate host headers for the web sites and set SPNs accordingly. NOTE: This issue is taken care of in IIS 7.0 with Kernal mode authentication. 
&lt;p&gt;Again,if you are using two web sites with same name but different ports like &lt;b&gt;&lt;i&gt;&lt;u&gt;http://servername:81&lt;/u&gt;&lt;/i&gt;&lt;/b&gt; and &lt;i&gt;&lt;b&gt;&lt;u&gt;http://servername:82&lt;/u&gt;&lt;/b&gt;&lt;/i&gt;; by default IE will request a ticket for the same SPN &lt;b&gt;&lt;i&gt;HTTP/servername&lt;/i&gt;&lt;/b&gt;. 
&lt;/p&gt;&lt;p&gt;We would then need an hotfix for the client machines, Refer to &lt;a href="http://support.microsoft.com/kb/908209" target="_blank" mce_href="http://support.microsoft.com/kb/908209"&gt;this&lt;/a&gt;. 
&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;When do we have Duplicate SPNs leading to kerberos not working? &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Duplicate SPN arises from the fact that the same SPN is mapped to multiple accounts, it may be a machine or an user account. Doesn't matter. Mapping to multiple accounts will lead to duplicate SPNs!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;*Remember: You can have multiple different SPNs registered under the same account but not vice-versa, i.e. you should *not* have the same SPN registered under multiple accounts.&lt;/p&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;IIS uses NTLM credentials when accessing a resource for a local request coming to it (i.e. client say IE, and IIS are on the same box). It may use Kerberos or NTLM from a separate client machine depending on the setup.The best way to check if delegation is working is from a client machine which is not same as the IIS server. NTLM doesn't support delegation. Kerberos does!&lt;/li&gt;&lt;/ul&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At times making sure all the settings on the client, IIS, AD, back-end (if any) to make kerberos work properly doesn't help, and in such cases make sure that we purge all the kerberos tickets using Klist or Kerbtray on the client. In fact if possible logoff and re-login to the client machine from where you are testing the web application for kerberos authentication so that the client is issued a fresh ticket.&lt;/li&gt;&lt;/ul&gt;
&lt;p mce_keep="true"&gt;&amp;nbsp;*Check the following &lt;a href="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx" target="_blank" mce_href="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx"&gt;link&lt;/a&gt; for my other posts related to Kerberos.&lt;/p&gt;
&lt;p&gt;Till next time...&lt;img src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/martini.gif" alt="Martini Glass" mce_src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/martini.gif"&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9102793" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Authentication/default.aspx">Authentication</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>Kerberos troubleshooting from IIS perspective</title><link>http://blogs.msdn.com/saurabh_singh/archive/2007/01/29/kerberos-troubleshooting-from-iis-perspective.aspx</link><pubDate>Mon, 29 Jan 2007 09:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1550261</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/1550261.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=1550261</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=1550261</wfw:comment><description>&lt;P&gt;Hi All, &lt;/P&gt;
&lt;P&gt;This is my first posting in the blog. &lt;/P&gt;
&lt;P&gt;I really had to take enough courage to start blogging, but with some help from one of my mentors in MS, I am finally here. &lt;/P&gt;
&lt;P&gt;I hope people really get benefitted from the articles that I post in here. &lt;/P&gt;
&lt;P&gt;Today, I am going to talk about how to implement Kerberos authentication for IIS. I have chosen this topic after a lot of consideration. This topic has always evoked a state of anxiety and fear among Web administrators and MS PSS support engineers alike. Also this has been a pain for us since a lot of calls that we receive are related to Kerberos authentication failure and causes a lot of labor and revenue loss to MS and customers. &lt;/P&gt;
&lt;P&gt;So here it goes... &lt;/P&gt;
&lt;P&gt;So what exactly is this Kerberos, first time when I heard of it I thought it must be some mystical word related to enchantment and what not. I went and looked into the dictionary and found something similar. It meant a fierce three-headed dog figure from Greek mythology that guarded the gates of the underworld. Kerberos protocol, similar to the dog figure has three main sections: client, server and an intermediary called Key distribution centre (KDC). &lt;/P&gt;
&lt;P&gt;So how exactly is this Kerberos protocol work: &lt;/P&gt;
&lt;P&gt;There are numerous articles that you can find which will give you an insight as to how Kerberos protocol works, so instead of explaining some redundant stuffs here which might confuse you a bit more (like the way it did to meJ), I will be very lucid and straight in my explanation, and concentrate more on troubleshooting than getting into various jargons associated with it. Let me know if you need articles on the topic and I can post it here. &lt;/P&gt;
&lt;P&gt;Simply speaking, a client requests a ticket (or token) from an Intermediary called Key Distribution centre (KDC) for accessing any service registered with it. In our case to access a web service, it looks for an authenticated token to access the web services, and once getting a unique short-term session key from the KDC, directly contacts the IIS server hosting the web service. IIS in turn receives the token its own session key and since it is authenticated by the KDC with which the IIS service has been registered authenticates the client to access the application running on it. Remember authentication and authorization are two different terms. A client might be authenticated still might not be able to access the resource because of lack of authorization to access it. &lt;/P&gt;
&lt;P&gt;To understand the details of how a Kerberos protocol works, I recommend reading MS knowledge base or Technet. &lt;/P&gt;
&lt;P&gt;Before you configure Kerberos authentication for your site, I recommend having these tools handy: &lt;/P&gt;
&lt;P&gt;SETSPN (For adding, listing, deleting SPN entries for a domain) &lt;/P&gt;
&lt;P&gt;KERBTRAY (For checking the Kerberos ticket used by the client to access a web server. It gives you information as to which ticket is being used by the client to access the IIS server, and whether the ticket is capable of delegation). &lt;/P&gt;
&lt;P&gt;I will take up a scenario where you want to implement Kerberos delegation to work in this architecture. It is also called double-hop since client's credentials are hopped twice from the client to the IIS web server to the backend SQL server to access a resource. I suggest there are very good articles present elsewhere on Microsoft site where you can get in depth information on how Kerberos authentication works. I have concentrated more on troubleshooting, so you can skip to the next section J. &lt;/P&gt;
&lt;P&gt;We assume client, IIS server and the backend SQL server in the same domain. The same scenario will also work if you have the components in different domains but they are mutually trusted both ways. &lt;/P&gt;
&lt;P&gt;As a troubleshooting process, start with only Basic authentication enabled on IIS server and then test from a client machine to see if that works successfully. If it works, we are good to proceed further with Windows integrated authentication as the only enabled authentication on IIS (make sure that we do not have Anonymous authentication selected in the IIS mmc console). &lt;/P&gt;
&lt;P&gt;&lt;I&gt;The following checklist gives you an insight of the basic configuration required for Kerberos to work in double hop scenario from IIS perspective.&lt;/I&gt; &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Non-NLB Scenario&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;IE : IIS : SQL Server &lt;BR&gt;=============================== &lt;BR&gt;IE-IIS-Share &lt;BR&gt;{All using default accounts, for eg. In IIS 6.0, app pool running under Network service or Local system.} &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;IE: &lt;BR&gt;- Add the URL to "Local Intranet Zone" &lt;BR&gt;- Enable Windows Integrated Authentication &lt;BR&gt;- Automatic logon with current username and password or, Automatic logon only in Intranet Zone &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;IIS: &lt;BR&gt;- Only "Windows Integrated Authentication" is checked. &lt;BR&gt;Type in &amp;gt; cscript adsutil.vbs get w3svc/ntauthenticationproviders (You need to run this from &amp;lt;system drive&amp;gt;/inetpub/adminscripts) &lt;BR&gt;- Make sure that this command shows &amp;gt; Negotiate, NTLM; or there is no value set. &lt;BR&gt;Else type in &amp;gt; cscript adsutil.vbs set w3svc/ntauthenticationproviders Negotiate, NTLM &lt;BR&gt;- Make sure to cross check the same at individual website/virtual directory level by using the command &amp;gt; cscript adsutil.vbs find ntauthenticationproviders. &lt;BR&gt;SPN: &lt;BR&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;computer-name&amp;gt;&lt;STRIKE&gt;:&amp;lt;port&amp;gt;&lt;/STRIKE&gt; &amp;lt;iis-computer-name&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;FQDN&amp;gt; &amp;lt;iis computer-name&amp;gt; &lt;BR&gt;&lt;STRIKE&gt;CAUTION: Putting the &amp;lt;port&amp;gt; has been dicey. At times it works and at times it doesn't (only my own experienceJ).&lt;/STRIKE&gt; I will recommend not using it when you set the SPN.&lt;BR&gt;Domain Controller (DC): &lt;BR&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp; Under Active Directory Users and Computers -&amp;gt; &amp;lt;Domain&amp;gt; -&amp;gt; Computers, Select the IIS server, right click -&amp;gt;Properties-&amp;gt;Delegation tab &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Make sure that "Trust this Computer for delegation to any service (Kerberos only) is selected, or else "Trust this computer for delegation to specified services only" is selected. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (You will get this option if the Domain functional level is Windows Server 2003 only). &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The 1st option is more generic and is good while you are implementing it for testing the first time. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; When the 2nd option is checked, you can go ahead with any of the options: "Use Kerberos only" or "Use any authentication protocol". In such a case make sure that you are selecting the right service Type running on the backend service for which you need delegation. Let's say if you have SQL server running at the backend to which you want the IIS to delegate the credentials, we need to add service type as "MSSQLSVC" and default port as 1433. &lt;BR&gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt; &lt;BR&gt;IE-IIS-Share &lt;BR&gt;{App Pool running under Domain account} &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;Domain account configuration: &lt;BR&gt;- Account is trusted for delegation &lt;BR&gt;- Is a member of IIS_WPG group on the local IIS computer &lt;BR&gt;- Has "Act as a part of Operating System"/"Impersonate a client after authentication" privileges. &lt;BR&gt;IE: &lt;BR&gt;- Add the URL to "Local Intranet Zone" &lt;BR&gt;- Enable Windows Integrated Authentication &lt;BR&gt;- Automatic logon with current username and password or, Automatic logon only in Intranet Zone. &lt;BR&gt;IIS: &lt;BR&gt;- Only "Windows Integrated Authentication" is checked. &lt;BR&gt;Type in &amp;gt; cscript adsutil.vbs get w3svc/ntauthenticationproviders (You need to run this from &amp;lt;system drive&amp;gt;/inetpub/adminscripts) &lt;BR&gt;- Make sure that this command shows &amp;gt; Negotiate, NTLM; or there is no value set. &lt;BR&gt;Else type in &amp;gt; cscript adsutil.vbs set w3svc/ntauthenticationproviders Negotiate, NTLM &lt;BR&gt;- Make sure to cross check the same at individual website/virtual directory level by using the command &amp;gt; cscript adsutil.vbs find ntauthenticationproviders. &lt;BR&gt;SPN: &lt;BR&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add the following: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;computer-name&amp;gt;&lt;STRIKE&gt;:&amp;lt;port&amp;gt;&lt;/STRIKE&gt; &amp;lt;domain user account&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;FQDN&amp;gt; &amp;lt;domain user account&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Remove the following: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;computer-name&amp;gt;&lt;STRIKE&gt;:&amp;lt;port&amp;gt;&lt;/STRIKE&gt; &amp;lt;iis-computer-name&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;FQDN&amp;gt; &amp;lt;iis-computer-name&amp;gt; &lt;BR&gt;&lt;STRIKE&gt;CAUTION: Putting the &amp;lt;port&amp;gt; has been dicey. At times it works and at times it doesn't.&lt;/STRIKE&gt; I will recommend not using it when you set the SPN. &lt;BR&gt;Domain Controller (DC): &lt;BR&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp; Under Active Directory Users and Computers -&amp;gt; &amp;lt;Domain&amp;gt; -&amp;gt; Computers , Select the IIS server, right click -&amp;gt;Properties-&amp;gt;Delegation tab &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Make sure that "Trust this Computer for delegation to any service (Kerberos only) is selected, or else "Trust this computer for delegation to specified services only" is selected. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (You will get this option if the Domain functional level is Windows Server 2003 only). &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The 1st option is more generic and is good while you are implementing it for the first time. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; When the 2nd option is checked, you can go ahead with any of the options: "Use Kerberos only" or "Use any authentication protocol". In such a case make sure that you are selecting the right service Type running on the backend service for which you need delegation. Let's say if you have SQL server running at the backend to which you want the IIS to delegate the credentials, we need to add service type as "MSSQLSVC" and default port as 1433. &lt;BR&gt;If you still encounter problems try checking for duplicate SPNs. &lt;BR&gt;- To find duplicate SPNs &lt;BR&gt;&amp;nbsp; Use command prompt to execute this command on dc: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;B&gt;ldifde&lt;/B&gt; -f &amp;lt;filename&amp;gt; -d "&amp;lt;dc=domain-netbiosname,dc=primary-domain&amp;gt;" -l serviceprincipalname -r "(serviceprincipalname=&amp;lt;serviceprincipalname-to-check-for-duplicates&amp;gt;)" -p subtree &lt;BR&gt;e.g. if the domain name is test.abcd.com: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldifde –f C:\log.txt -d "dc=test, dc=abcd, dc=com"-l serviceprincipalname –r "(serviceprinicpalname=http/test.abcd.com)" -p subtree &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;NLB Scenario&lt;/B&gt; &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;Now we will talk about a scenario where IIS server is a part of Network load balancer (NLB). First thing, make sure that Kerberos is supported by your NLB (hardware or software). The settings for Kerberos are a bit different when you configure it for IIS servers running as NLB nodes. Here you don't have to set SPNs for individual IIS nodes; rather you need to set an SPN entry for the Virtual IP or alias of the Load balancer. It can be hardware or software. &lt;/P&gt;
&lt;P&gt;IE-IIS-Share &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;{All using default accounts} &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;IE: &lt;BR&gt;- Add the URL (here the URL is the NLB's virtual URL or alias) to "Local Intranet Zone" &lt;BR&gt;- Enable Windows Integrated Authentication (Internet Options-&amp;gt;Advanced-&amp;gt;Security) &lt;BR&gt;- "Automatic logon with current username and password" or "Automatic Logon only in Intranet Zone" &lt;/P&gt;
&lt;P&gt;IIS: &lt;BR&gt;Type in &amp;gt; cscript adsutil.vbs get w3svc/ntauthenticationproviders (You need to run this from &amp;lt;system drive&amp;gt;/inetpub/adminscripts) &lt;BR&gt;- Make sure that this command shows &amp;gt; Negotiate, NTLM; or there is no value set. &lt;BR&gt;Else type in &amp;gt; cscript adsutil.vbs set w3svc/ntauthenticationproviders Negotiate, NTLM &lt;BR&gt;- Make sure to cross check the same at individual website/virtual directory level by using the command &amp;gt; cscript adsutil.vbs find ntauthenticationproviders. &lt;BR&gt;- Setup the IIS Servers for delegation as mentioned in the above steps. &lt;BR&gt;- Only "Windows Integrated Authentication" is used in IIS. &lt;BR&gt;- If it's an NLB environment, we need to run the IIS application under an App pool running with domain user account. &lt;BR&gt;- The domain user account should be trusted for delegation in the Active Directory. &lt;BR&gt;&amp;nbsp;&amp;nbsp; From Active Directory Users and Computers, go to the properties of the IIS User (Domain user account). On the Delegation Tab, select "Trust this user for delegation to any service (Kerberos only)" &lt;BR&gt;- The domain user account should be a part of IIS node's IIS_WPG group. &lt;BR&gt;- We need to set the above settings for all the IIS nodes in the NLB. &lt;BR&gt;- Also add the same host header entry for the NLB URL in all the IIS nodes in the IIS manager console -&amp;gt;&amp;lt;website&amp;gt;-&amp;gt;Properties-&amp;gt;Web Site-&amp;gt; Advanced tab. &lt;/P&gt;
&lt;P&gt;SPN: &lt;BR&gt;- For IIS: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;Netbios name of the NLB&amp;gt;&amp;nbsp; &amp;lt;Domain user account&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;FQDN of the NLB&amp;gt;&amp;nbsp; &amp;lt;Domain user account&amp;gt; (If we are running the site on port 80, otherwise http/&amp;lt;FQDN of the NLB&amp;gt;&lt;STRIKE&gt;:&amp;lt;Port&amp;gt;&lt;/STRIKE&gt;&amp;nbsp; &amp;lt;Domain user account&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRIKE&gt;CAUTION: Putting the &amp;lt;port&amp;gt; has been dicey. At times it works and at times it doesn't.&lt;/STRIKE&gt; I will recommend not using it when you set the SPN even when your site is running under a different port other than the default 80.&lt;/P&gt;
&lt;P&gt;We need to make sure that we do NOT have SPN entries set for http/&amp;lt;FQDN&amp;gt;&amp;nbsp; &amp;lt;iis computer-name&amp;gt; for any of the IIS nodes. &lt;/P&gt;
&lt;P&gt;Command: &amp;gt;Setspn –A http/&amp;lt;FQDN of the NLB&amp;gt;&amp;nbsp; &amp;lt;Domain user account&amp;gt; &lt;BR&gt;When we are using Constrained delegation make sure that the backend service is listed in list of services, for e.g. in case we are connecting to SQL server at the backend add MSSQLSVC in the Machine/user properties-&amp;gt;Delegation tab. &lt;BR&gt;Note: When we are accessing the web application from a client machine, I suggest installing Kerbtray on the client machine and checking for the "OK as Delegate" option in the attributes section for the corresponding SPN. If it is selected it means the ticket can be used for delegating credentials from the IIS server to the backend server. If it is not then it means there are some issues with the settings in IIS or somewhere else. Using Netmon trace is always a good idea to figure out what tickets are being used or looked for by the Client when accessing the Web application. &lt;/P&gt;
&lt;P&gt;In case you face any issues related to Kerberos authentication failure, do the following to understand more from the event logs &lt;BR&gt;- Make sure that we have enabled Kerberos logging according to &lt;A href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;262177" mce_href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;262177"&gt;http://support.microsoft.com/default.aspx?scid=kb;EN-US;262177&lt;/A&gt; on all the IIS nodes. &lt;BR&gt;- Apart from that, you also need to make sure that on all the IIS servers, these two settings are enabled. &lt;/P&gt;
&lt;P&gt;Start-&amp;gt;Programs-&amp;gt;Administrative tools-&amp;gt;Local security Policy-&amp;gt;Security settings-&amp;gt;Local Policies-&amp;gt;Audit Policy-&amp;gt;Audit account logon events-&amp;gt;"Success, Failure". &lt;/P&gt;
&lt;P&gt;Start-&amp;gt;Programs-&amp;gt;Administrative tools-&amp;gt;Local security Policy-&amp;gt;Security settings-&amp;gt;Local Policies-&amp;gt;Audit Policy-&amp;gt;Audit logon events-&amp;gt;"Success, Failure". &lt;/P&gt;
&lt;P&gt;NOTE: &lt;/P&gt;
&lt;P&gt;At times making sure all the above changes are done properly doesn't help, and in such cases make sure that we purge all the kerberos tickets using Klist or Kerbtray. In fact if possible logoff and re-login to the client machine from where you are testing the web application for kerberos authentication so that the client is issued a fresh ticket. &lt;/P&gt;
&lt;P&gt;Additional Info: &lt;BR&gt;================&lt;/P&gt;
&lt;P&gt;You might see this error in the event logs in DC: &lt;BR&gt;Event Type: Error &lt;BR&gt;Event Source: KDC &lt;BR&gt;Event Category: None &lt;BR&gt;Event ID: 11 &lt;BR&gt;Date: 4/1/2002 &lt;BR&gt;Time: 1:40:14 PM &lt;BR&gt;User: N/A &lt;BR&gt;Computer: ComputerName Description: &lt;BR&gt;There are multiple accounts with name host/mycomputer.mydomain.com of type 10. &lt;/P&gt;
&lt;P&gt;This might be because of Duplicate SPNs. There are two or more computer accounts that have the same service principal names (SPNs) registered. Please refer to KB 321044 for further info. Remember, you can use &lt;B&gt;Ldifde&lt;/B&gt; to check for duplicate SPNs as mentioned above.&lt;BR&gt;Few Links: &lt;BR&gt;For configuring backend SQL server to accept Kerberos authentication go through this link: &lt;A href="http://support.microsoft.com/kb/319723/en-us" mce_href="http://support.microsoft.com/kb/319723/en-us"&gt;http://support.microsoft.com/kb/319723/en-us&lt;/A&gt; &lt;BR&gt;Also a good article on IIS Kerberos authentication &lt;A href="http://support.microsoft.com/kb/907272/en-us" mce_href="http://support.microsoft.com/kb/907272/en-us"&gt;http://support.microsoft.com/kb/907272/en-us&lt;/A&gt; and &lt;A href="http://support.microsoft.com/?id=929650"&gt;http://support.microsoft.com/?id=929650&lt;/A&gt;&lt;BR&gt;How to configure an Asp.Net application for a delegation scenario: &lt;A href="http://support.microsoft.com/kb/810572/" mce_href="http://support.microsoft.com/kb/810572/"&gt;http://support.microsoft.com/kb/810572/&lt;/A&gt; &lt;BR&gt;PS: Remember to test whether delegation is working fine, you need to access the website URL from a workstation (client) browser and not from IIS server itself. &lt;/P&gt;
&lt;P&gt;Reason: IIS uses NTLM credentials when accessing the backend when request reaches it from the local server if, Kerberos fails and there is only single hop involved. NTLM will work with single hop and hence if you access a site locally from the IIS web server it is a single hop and not a double hop scenario.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;One simple &lt;A title="what is mantra?" href="http://www.thefreedictionary.com/mantra" target=_blank mce_href="http://www.thefreedictionary.com/mantra"&gt;mantra&lt;/A&gt; to be remembered always: You can have multiple different SPNs registered under an account but not the other way, i.e. you should not have the same SPN registered under multiple accounts because it leads to duplicate SPN issue.&lt;/P&gt;
&lt;P&gt;***************************************************** Addition to the blog&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;Think about a scenario where &lt;A href="http://server/app1"&gt;http://server/app1&lt;/A&gt; and &lt;A href="http://server/app2"&gt;http://server/app2&lt;/A&gt; are running inside a network service &amp;amp; a domain user identity respectively .&lt;BR&gt;The SPNs requested will be http/server in both the cases, and since we can’t have duplicated SPNs it won’t work. We need to then either use the same server process identity or dedicated host headers.&lt;/P&gt;
&lt;P&gt;Again,if you are using two websites with same name but different ports like &lt;A href="http://server/"&gt;http://server:80&lt;/A&gt; and &lt;A href="http://server:81/"&gt;http://server:81&lt;/A&gt;; by default IE will request a ticket for the same SPN HTTP/server.&lt;/P&gt;
&lt;P&gt;We would then need an hotfix for the client machines, &lt;A href="http://support.microsoft.com/kb/908209"&gt;http://support.microsoft.com/kb/908209&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If you have two websites &lt;A href="http://application1/"&gt;http://application1&lt;/A&gt; and &lt;A href="http://application2/"&gt;http://application2&lt;/A&gt; that are both DNS aliases (CNAMEs) of say myserver DNS host, IE will request the ticket for SPN HTTP/myserver for both the above websites. By default IE does't use port for sending the ticket and just the SPN name like, &lt;B&gt;http/mysite&lt;/B&gt;:99, It ignores the port part of it.&lt;BR&gt;Then you would need client fix &lt;A href="http://support.microsoft.com/kb/911149"&gt;http://support.microsoft.com/kb/911149&lt;/A&gt;, or use a different DNS HOSTs rather than CNAMEs.You might well go ahead with using a host headers for the websites.&lt;/P&gt;
&lt;P mce_keep="true"&gt;[Something to add here with regard to using IP Addresses to access a site...&lt;/P&gt;
&lt;P&gt;There is another confusion that people have while dealing with Kerberos authentication. At times you may want to use IP addresses to access a website and still want Kerberos authentication to work. Now in a general scenario this will not work because Kerberos requires SPN's to recognize a service like HTTP etc. You can however make it work by adding SPN's in the form: http/10.0.1.25 (website's IP) etc. This may or may not work.&lt;/P&gt;
&lt;P&gt;However we do not recommend the above way to make Kerberos work for your site using IP addresses. The reason being that SPN's should ideally be names like http/&amp;lt;somename&amp;gt; and not http/&amp;lt;some IP address&amp;gt;.&lt;/P&gt;
&lt;P&gt;Let's consider a scenario wherein users belong to domain2 and the Web server is part of domain1. Also let's assume we have mutual trust between domain1 and domain 2. When using IP addresses, client will look for SPN HTTP/10.0.1.25 (assuming this is website's IP on domain1) in domain2 (client's local domain).&lt;/P&gt;
&lt;P&gt;Now you may get into an issue wherein domain2 will not give any referral back to to the client to look into domain1 for the SPN. This can occur if IP address is being used to look for a service. In such a case even after adding SPN's for IP addresses, Kerberos won't work and will fall back to NTLM.&lt;/P&gt;
&lt;P&gt;]&lt;/P&gt;
&lt;P&gt;***Update: Regarding confusion around Port entry in SPNs, check this &lt;A href="http://technet.microsoft.com/en-us/library/cc263449.aspx#section4"&gt;http://technet.microsoft.com/en-us/library/cc263449.aspx#section4&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Happy troubleshooting…and in case you still face issues, Microsoft Product Support Services (PSS) is always there to help you! &lt;/P&gt;
&lt;P&gt;Feel free to shoot me a question if you have any confusion or need some assistance.&lt;/P&gt;
&lt;P&gt;*Check the following &lt;A href="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx" target=_blank mce_href="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx"&gt;link&lt;/A&gt; for my other posts related to Kerberos.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1550261" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setup/default.aspx">Setup</category></item></channel></rss>