wcf web service identity servicePrincipalName explanation required
<p>I have a web service that uses windows integrated authentication, and it works. But only after much trial and error it only finally worked with my config file endpoint section having an identity as follows:</p>

<pre><code>&lt;identity&gt;
      &lt;servicePrincipalName value="host/servername" /&gt;
&lt;/identity&gt;
</code></pre>

<p>Where 'servername' is the name of the IIS server hosting the webservice.</p>

<p>If I missed it out, IIS refused it (did not even get to the end point) with 'authentication error'.</p>

<p>However, when I recently needed to run a program on the same server as the web service this then failed with the same error and it worked only if I completely removed the identity or changed it to 'host/localhost'.</p>

<p>Can somebody explain why this is because I really don't understand what the servicePrincipalName/identity is really doing other than just working.</p>

<p>thanks.</p>