title: Consuming a WCF with an Identity set on Endpoint: correct UPN does not work
body: <p>I wrote a Windows Service hosted WCF service. Deployed or localhost works fine, my client app can consume it.</p>
  
  <p>If I change the LogOn setting of the Windows Service and set a domain user (changing from the default "Local System") my client app cannot consume the service anymore. The exception I get is </p>
  
  <pre><code>A call to SSPI failed
  </code></pre>
  
  <p>There is no inner exception or any details. To fix this I tried to set the UPN in my client app request in order to get a valid service name check. This is done, client side, via code, setting an Identity in the endpoint:</p>
  
  <pre><code>string uri = "myServiceUri";
  EndpointIdentity identity = EndpointIdentity.CreateSpnIdentity("user@domain");
  EndpointAddress epa = new EndpointAddress(uri, identity, new AddressHeader[] { });
  </code></pre>
  
  <p>There comes the very strange behavior.</p>
  
  <ul>
  <li><p>If I set the exact UPN in my client request, lets say "user@domain",
  I get a new exception (no inner exception, no details)</p>
  
  <pre><code>The following remote identity failed verification: 'user@domain'
  </code></pre></li>
  <li><p>If I set any other string as UPN in my client request, it works fine,
  let's say "<em>XXXuser@domainXXX</em>", "<em>toto</em>", or even <em>String.Empty</em>.</p></li>
  </ul>
  
  <p>Server side, I did not set any Identity node in config file to keep default behavior, ie UPN check (no SPN nor DNS).</p>
  
  <p>In other words, the Service/User name check seems to work only if the settings in my client app is <em>wrong</em>.</p>
  
  <p>Dear community, your help would be very appreciated on this topic.</p>
  
  <p>Thanks</p>