• Sign In
 
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...
Common Tasks
  • Blog Home
  • Email Blog Author
  • RSS for comments
  • RSS for posts
Search
  • Advanced search options...
Tags
  • .NET Framewor
  • .NET Framework
  • Ajax/Javascript
  • ASP.NET
  • CLR
  • Cool stuff
  • DataAccess
  • Debugging/Windbg
  • Hotfix/Service Pack
  • IDEVDataCollector
  • IIS
  • Internet Explorer
  • Italian techs
  • LogParser
  • OT
  • Personal
  • Productivity
  • Random
  • Scripting/ASP
  • Security
  • Technology
  • Tools
  • Troubleshooting
  • Vista/Longhorn
  • Visual Studio
Archives
Archives
  • November 2010 (1)
  • October 2010 (1)
  • July 2010 (2)
  • April 2010 (1)
  • March 2010 (2)
  • February 2010 (2)
  • January 2010 (1)
  • October 2009 (2)
  • September 2009 (2)
  • August 2009 (1)
  • July 2009 (5)
  • June 2009 (1)
  • May 2009 (1)
  • April 2009 (3)
  • March 2009 (3)
  • February 2009 (5)
  • January 2009 (3)
  • December 2008 (5)
  • November 2008 (3)
  • October 2008 (2)
  • September 2008 (3)
  • August 2008 (3)
  • July 2008 (3)
  • June 2008 (5)
  • May 2008 (4)
  • April 2008 (8)
  • March 2008 (4)
  • February 2008 (5)
  • January 2008 (2)
  • December 2007 (4)
  • November 2007 (6)
  • October 2007 (6)
  • September 2007 (8)
  • August 2007 (6)
  • July 2007 (7)
  • June 2007 (10)
  • May 2007 (9)
  • April 2007 (12)
  • March 2007 (8)
  • February 2007 (5)
  • January 2007 (3)
  • December 2006 (1)
  • November 2006 (4)
  • October 2006 (2)
  • September 2006 (9)
  • August 2006 (2)
  • July 2006 (1)

Unable to "InitializeSecurityContext"?

MSDN Blogs > Never doubt thy debugger > Unable to "InitializeSecurityContext"?

Unable to "InitializeSecurityContext"?

Carlo Cardella
18 Jul 2007 4:48 PM
  • Comments 1

Sometimes having fortune at your side can really save you the day (to say the least), and in developer support it can save you hours (of not days) of troubleshooting... With this premise, a couple of weeks ago I was helping a colleague from the Sql Server support team whom was struggling with an authentication problem one of his customers was having with Reporting Services: basically IIS was prompting them to login to access the application, but even entering the correct credentials those were refused, and after three strikes they were redirected to the standard 401 (unauthorized) page.

While waiting for some logs I requested to the customer, I was building a repro for another customer I had at the same time (with a completely different problem, that was a weird runtime exception I'll likely write about in another post), and one of the requisites was to have the application pool running under a domain account instead of the default NETWORK SERVICE: well... I got the same problem reported by the first customer! smile_whatchutalkingabout  It worth mentioning that I was also using Integrated Authentication for the virtual directory, and interestingly, the problem disappeared if I was using a local account for the application pool.

To kill two birds with one stone, I opened WFETCH to understand what was going wrong.

First fact: if you are running with a local account, you'll use NTLM and not Kerberos, and NTLM was working fine.

Second fact: using WFETCH to access the same URL (with the app pool running as domain account) returned 0x80090322 (The target principal name is incorrect.): “Unable to InitializeSecurityContext”

The error means that the account used to run the process does not have permission to log-in as a service; in my repro I found a domain policy was setting that value, and the customer told me they had the same. So, to resolve the problem I run the following command:

cscript C:\inetpub\AdminScripts\adsutil.vbs set w3svc/NtAuthenticationProviders "NTLM"
(you may also want to have a look at this KB)

Note that this will prevent you from using delegation (which is possible only using Kerberos), but the customer didn't need it so he was happy with this solution and the story stopped here...

 

Carlo


Quote of the Day:
When you get to the end of your rope, tie a knot and hang on.
--Franklin D. Roosevelt
  • 1 Comments
ASP.NET, IIS
Leave a Comment
  • Please add 2 and 8 and type the answer here:
  • Post
Comments
  • Chris Bilson
    8 Aug 2007 9:05 AM

    Your post just saved me a ton of grief! I was preparing a monster request to our IT group to get a service principal name, a new DNS alias, etc., as in http://msdn2.microsoft.com/en-us/library/ms998297.aspx, until I saw your post and realized I don't need delegation for my app. Thanks!

Page 1 of 1 (1 items)
  • © 2012 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy Statement
  • Report Abuse
  • 5.6.402.223