theraneman
theraneman

Reputation: 1630

Unable to get WCF service authentication working with IIS 6.0

I am going to try to keep this question as brief as possible since the problem is a little tricky to explain for me. Please ask any queries if something is left unclear. So here you go,

This is the error message I have been getting for a while as I am working on this, "The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'Negotiate,NTLM'. The remote server returned an error: (401) Unathorized"

I have two Windows boxes, Box1 and Box2. I have 2 WCF services (ServiceA and ServiceB) hosted in IIS 6 on each of them. Functionally, ServiceA talks to db only. ServiceB talks to ServiceA and gets results. Both services have anonymous access and Integrated Windows authentication enabled. ServiceA runs under Application pool ServiceAPool and ServiceB runs under ServiceBPool. Each of these app pools have configured identity of a domain user. These app pools are exactly same on Box1 and Box2.

First, My client application (just a small console app), calls ServiceA on Box1 with my Windows credentials. It works.

Second, My client application , calls ServiceB on Box1 with my Windows credentials. This ServiceB calls ServiceA internally with domain user (app pool identity) It works.

The Second point I mentioned above does not work on Box2, it gives the above error. Just to be clear, the service code including web.config file etc is exactly same on both boxes. The domain user for app pool is the same. Both boxes are on same domain.

What I have observed is (probably), on Box2, when I call ServiceA with my windows credentials, it works, but when there is a hop between services with some other domain account (like my app pool account) it fails with the error above.

If anyone has seen such kind of behavior please share some information.

Upvotes: 0

Views: 498

Answers (1)

theraneman
theraneman

Reputation: 1630

I would like to post an answer to my own question. It turned out to be a friggin registry key update to get the authentication work just fine. Basically it was about disabling "DisableLoopbackCheck" value. More information can be found at

http://blogs.msdn.com/b/distributedservices/archive/2009/11/10/wcf-calling-wcf-service-hosted-in-iis-on-the-same-machine-as-client-throws-an-authentication-error.aspx

http://support.microsoft.com/default.aspx?scid=kb;EN-US;926642

Upvotes: 1

Related Questions