Hosting a WCF service with Windows authentication
In the previous sections, we learned how to host a WCF service with basic authentication. As you can see, with basic authentication, the client has to capture the user's credentials (the credentials are hardcoded, taken from a configuration file, or the user is prompted to enter them), and the credentials are transported in clear text unless HTTPS is configured.
This might be an acceptable approach if the clients are outside your domain, that is, from the Internet or extranet. However, for intranet clients, a better approach is to use Windows authentication so that you don't need to capture the user's credentials. Instead, you can use the user's network credential token and pass it to the WCF service. In this section, we will configure our WCF service to use this authentication mode.
As we have the IIS application and the test client for basic authentication ready, we will just modify them to enable Windows authentication...