Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove NEGOTIATE from WindowsAuthentication in IIS

I have a site running in IIS 7.5 that is accessed using a DNS alias different from the actual server name. In IE 8, integrated authentication is failing, but in Firefox and Chrome everything works fine. (IE presents a credential challenge a few times, then displays a 401.1 error page.)

I have figured out that this is due to IE using Kerberos (aka "Negotiate") over NTLM, and Kerberos requires registering a Service Principal Name (using SETSPN) so that the mismatch between the DNS name and the server name is properly handled.

My web site, however, doesn't need impersonation--it is enough to have delegation. So instead of messing with SetSPN, I would just like to remove "Negotiate" from the list of WindowsAuthentication methods in IIS.

I have searched for quite some time to find out how to do this in IIS. I have played with many appcmd commands--but I just can't find online examples, or figure out how by reading MSDN documentation or using appcmd /? to make appcmd commands apply only to a particular application within a site rather than to the entire web server. A few search-hours later over two days, and at least 3 dozen web pages visited, I am still coming up fruitless.

How in tarnation do I get this done--it seems like it should be so easy!

like image 712
ErikE Avatar asked Apr 25 '13 19:04

ErikE


1 Answers

Open the Configuration Editor in IIS. It comes with IIS 7.5, or you can download the IIS administration pack for IIS 7.0. Navigate to the scope you want to affect (server, site, or application) and then open the icon:

IIS Configuration Editor.

Change the Section to system.webServer/security/authentication/windowsAuthentication:

IIS Configuration Editor - Windows Authentication

Click on the providers item, and then click Edit Items on the right. Select the "Negotiate" item and click "Remove":

IIS Configuration Editor - Windows Authentication - providers

Close the dialog and click Apply in the Actions pane on the right.

Your problem is solved! No more Kerberos/negotiate!

Note: you can also click Generate Script in the actions pane to display the code that will make the change in either C#, javascript, or with appcmd from the command line.

For reference, here is the appcmd statement to do the job without using the Configuration Editor.

appcmd.exe set config "Virtual/path/to/application" -section:system.webServer/security/authentication/windowsAuthentication /-"providers.[value='Negotiate']" /commit:apphost
like image 112
ErikE Avatar answered Nov 28 '22 10:11

ErikE