Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSPI: user principle name WCF client

I am trying to access a wcf client. I know people are getting information out of it right now, so I know it works. My problem is I can't seem to get past it. The service is a mutual certific service. I have the appropriate certs in my personal stores on my local machine. Even with that, I get the following exception:

 A call to SSPI failed, see inner exception

Searching deep into the exception and I see this:

Message : The target principal name is incorrect

How can I resolve this? Do I need to impersonate the user the app pool is running under? Do I need to add an Identity\ServicePrincipleName or Identity\UserPrincipleName? Has anyone run into an issue similar to this?

like image 817
SoftwareSavant Avatar asked Jan 09 '13 13:01

SoftwareSavant


2 Answers

See my answer to a similar problem here: netTCP binding Soap Security Negotiation Failed. This guidance should apply to other bindings, not just TCP.

like image 64
sfuqua Avatar answered Oct 08 '22 04:10

sfuqua


For future reference for others, I experienced this issue but the existing answers didn't help.

My issue was with the userPrincipalName being used for a service reference.

I had recently re-registered the service reference in order update it but it had overwritten the specified userPrincipalName in the log files with my email address:

<endpoint address="net.pipe://localhost/XXXX"
  binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IXXX"
  contract="XXXServiceReference.IXXX"
  name="NetNamedPipeBinding_IXXXX">
  <identity>
    <userPrincipalName value="[email protected]" />
  </identity>
</endpoint>

To rectify the issue, I simply changed the userPrincipalName to localhost, which it what it was previously:

<userPrincipalName value="localhost" />
like image 45
Martin Avatar answered Oct 08 '22 05:10

Martin