The record and playback of the NTLM authenticated server are not straightforward in DevTest.
NTLM is actually a 3 request handshake where the client (browsers, apps, etc.) don't send any credentials on their first request for a resource. This means that the first request is anonymous, even if credentials have been configured for that resource. This anonymous request, when Windows Auth is enabled and Anonymous Auth is disabled, results in an HTTP 401 status.
The 2nd request would be the NTLM challenge where the client re-sends the original request with an additional "Authorization" header, containing the NTLM Type-1 message. The server then sends the NTLM challenge (Type-2 message) back to the client with HTTP 401 status.
The 3rd request would be the original request where the client sends it one more time by adding the challenge response (NTLM Type-3 message) in the "Authorization" header. The server then authenticates the user and sends back the response with HTTP 200 status (if successful).
As NTLM authenticated web service makes 3 requests (in fact all are the same 'EXACT' requests including arguments in the 'DevTest' world) for a single transaction with(or without) Authorization header depending on the response during the handshake, the current default matching logic in DevTest would fail to give the correct responses during playback. Also, it depends on how the client is executing the calls during playback. It can be a full handshake(3 requests) for every call or 2 requests by preemptively sending the NTLM web authentication type-1 message or just one request by sending NTLM type-2 message directly( as obtained from a separate login call) without repeating handshake. So it becomes challenging for DevTest to perform the matching of incoming requests from clients with an appropriate response.
Release : 10.6
Component : CA Service Virtualization
Add an explicit matching logic to handle NTLM authentication during playback using any of the below methods.
Request#1 (Anonymous Request)
Request#2 NTLM Challenge
Request#3 Original Request
Perform full handshake (3 requests) as shown below and verify the responses:
. Raw Traffic file: NTLM_raw_traffic.xml - use this sample file to record the NTLM authenticated service.