We’re trying to call WEB API using JsonServiceClient. The IIS is configured with Windows Authentication and we’ve to provide credentials.
However, it seems that setting up Credentials property of the client isn’t enough. If we just setting Credentials, we see the client sending 2 requests instead of one. The first request is returned with 401. Then JsonServiceClient sends another request with Authorization header.
What is a way to enforce JsonServiceClient to send the request with this header in first attempt?
It means that if I get to internal HttpWebRequest of the JsonServiceClient and set its PreAuthenticate property to true then any following JsonServiceClient instance will reuse the same credentials? Do you understand your answer correctly?