Setting up ad hoc Windows authentication over plain HTTP
WCF supports various authentication types and Windows authentication is a common authentication method used in existing distributed communication components on the Windows platform. A very common use case is to enable Windows authentication at transport layer without an additional secure connection like SSL (just like what the traditional ASMX Web Service uses).
In this recipe, we will demonstrate how to apply Windows authentication for a WCF service endpoint using plain HTTP as the transport protocol, without additional security.
How to do it...
Make the service endpoint use
BasicHttpBinding
.The first thing to do is choose
BasicHttpBinding
as the binding type of our WCF service endpoint. Also, in the binding configuration, we need to specify the security mode asTransportCredentialOnly
andclientCredentialType
asWindows
. The following screenshot shows theapp.config
section of our sample service endpoint.Adjust the Windows authentication...