title: "the target principal name is incorrect" 401 error
body: <p>So we have an small app that points to a report on a 2008 SSRS server.</p>
  
  <p>This app works fine normally, but since we added more websites to the server, we have changed the web app binding to something that is not the name of the server.</p>
  
  <p>This has caused us to get the following:</p>
  
  <blockquote>
    <p>The target principal name is incorrect  Description: An unhandled
    exception occurred during the execution of the current web request.
    Please review the stack trace for more information about the error and
    where it originated in the code. </p>
    
    <p>Exception Details: System.ComponentModel.Win32Exception: The target
    principal name is incorrect</p>
    
    <p>Source Error: </p>
    
    <p>An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of
    the exception can be identified using the exception stack trace below.</p>
    
    <p>Stack Trace: </p>
    
    <p>[Win32Exception (0x80004005): The target principal name is incorrect] 
    System.Net.NTAuthentication.GetOutgoingBlob(Byte[] incomingBlob,
    Boolean throwOnError, SecurityStatus&amp; statusCode) +2622099<br>
    System.Net.NTAuthentication.GetOutgoingBlob(String incomingBlob) +99<br>
    System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest
    webRequest, ICredentials credentials, Boolean preAuthenticate) +767<br>
    System.Net.NegotiateClient.Authenticate(String challenge, WebRequest
    webRequest, ICredentials credentials) +18<br>
    System.Net.AuthenticationManager.Authenticate(String challenge,
    WebRequest request, ICredentials credentials) +146<br>
    System.Net.AuthenticationState.AttemptAuthenticate(HttpWebRequest
    httpWebRequest, ICredentials authInfo) +2279623<br>
    System.Net.HttpWebRequest.CheckResubmitForAuth() +3031261<br>
    System.Net.HttpWebRequest.CheckResubmit(Exception&amp; e) +169</p>
    
    <p>[WebException: The remote server returned an error: (401)
    Unauthorized.]</p>
  </blockquote>
  
  <p>we added a spn for the new binding name to the SSRS server for the ID that runs the app, but nothing.  </p>
  
  <p>I see a lot of people who have SSPI issues doing this, but nothing with a 401 error.</p>
  
  <p>the ID we are using has full access to both boxes and if you can go directly from the web server to the SSRS without issue.  Its only when its wrapped in the app that we get an error.</p>
  
  <p>Has anybody run into this issue before?</p>
  
  <p>Thanks</p>