How to use Basic Authentication ?

Topics: Web Api
Nov 28, 2011 at 11:36 PM
Edited Nov 28, 2011 at 11:37 PM

Hello, everyone, I want to enable Basic Authentication and disable Anonymous Authentication in IIS, but when I called the restful web services, it showed a message like this:Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

Hope you can help me. 

Thanks in advance!

Nov 29, 2011 at 4:08 AM

You need to configure the WCF binding for basic auth.

Something like this:

binding.Security.Mode = SecurityMode.Transport;

binding.Security.Transport.ClientCredentialType =


You can access the binding security settings by configuring a Security action on HttpConfiguration.

Daniel Roth

Nov 29, 2011 at 7:28 AM

Thank you, danroth!