I\'m trying to communicate with a self-hosted WebAPI client using HttpClient
. The client is created with the following code:
HttpClientHandler clien
What you are experiencing is normal, this is how the NTLM authentication scheme works.
1: C --> S GET ...
2: C <-- S 401 Unauthorized
WWW-Authenticate: NTLM
3: C --> S GET ...
Authorization: NTLM
4: C <-- S 401 Unauthorized
WWW-Authenticate: NTLM
5: C --> S GET ...
Authorization: NTLM
6: C <-- S 200 Ok
GET
request to the server.401 Unathorized
response and notifies the client in the WWW-Authenticate
header that it supports NTLM
authentication. So this is where you get your first 401
response code.Authorization
header. Note that based solely on these information the client cannot be authenticated yet.401
response code.200
response code and the requested resource to the client.