NTLM authentication

Netty 4 and 3 don’t look compatible. Not sure what else to do.

I’ll try to mock an NTLM auth and reproduce the header duplicates you observe.
I will ping you on Thursday.

I’ve fixed quite a few things: https://github.com/AsyncHttpClient/async-http-client/issues/730

At least I think I have, as I don’t have a real NTLM system…

Could you give it a try please?

Now I get unauthorized access 401 error (checked userid/pwd at least 5 times).

I ran this without gatling libs but with netty 3.9.2. final sources.jar and new async client and it worked perfectly.

Here is the request from logs:

HTTP request:
GET http://xxxx
headers=
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEgAAADmAOYAYAAAABAAEABGAQAADgAOAFYBAAAG
AAYAZAEAABAAEABqAQAAFbKI4gUBKAoAAAAPq3GWgRCEBNkUc//IJ5ljiXHeDxGScgAUyqugKCyPHBQ2
hJkLGdupxAEBAAAAAAAAEMhAzc7dzwFx3g8RknIAFAAAAAACAAgAQwBPAFIAUAABABoASwBXAEEAVwBO
AEEAUABQAFQAUQAwADEAMQAEABwAYwBvAHIAcAAuAGYAaQBuAHIAYQAuAG8AcgBnAAMAOABLAFcAQQBX
AE4AQQBQAFAAVABRADAAMQAxAC4AYwBvAHIAcAAuAGYAaQBuAHIAYQAuAG8AcgBnAAUAHABjAG8AcgBw
AC4AZgBpAG4AcgBhAC4AbwByAGcABwAIADe3xczO3c8BAAAAAAAAAABOAEEAUwBEAEMATwBSAFAAZwBv
AGcAbgBhAGEAYgBlAHMAcACJOk4t+BRukQwI8ffVqpBU
Connection: keep-alive
Host: xxxx
Accept: /

On a side note - I really appreciate your help and support with gatling. I have been reading on its documentation and it seems very promising, especially scaling part. I am actually trying to do a proof of concept, so, we can adopt it in our organization as load testing tool. So please feel free to let me know if I can help you with debugging.

Abhinav

Sorry, I don’t get it.

After compiling the new async client, I replaced the old async client jar with this one in gatling lib and got 401 error - unauthorized access.

I used it with standalone code, it worked fine. Got response body back.

Then I added netty 3.9.2 jar to standalone - I got the 401 error unauthorized access.

Then I removed the netty 3.9.2 jar and replaced it with netty 3.9.2 final sources jar - it worked.

When I said it worked I meant on standalone code. It didn’t work with gatling libs.

“Then I removed the netty 3.9.2 jar and replaced it with netty 3.9.2 final sources jar - it worked.”

OK, so this procedure is wrong.
If you remove the netty jar, you ended using a JDK based implementation which is just a toy, not intended for production.
A source jar is just a zip with the sources, dropping it instead of the binary jar is just the same as removing.

As I don’t have a NTLM env, what I really need is:

  • the information pour pass to the Realm: login/password + NTLM domain and host if you set them

  • the expected NTLM handshake = the WWW-Authenticate and Authentication headers chain:

  • client sends bare request

  • server answers WWW-Authenticate: NTLM

  • client sends Type1 message: Authentication: NTLM something1

  • server replies with Type2 message: WWW-Authenticate: NTLM something2

  • clients then sends Type3 message: Authentication: NTLM something3

  • server replies 200 OK with expected resource

Without this, I’m just shooting in the dark.

When I use the recorder, initially, I did get all client response with ntlm authentication headers. Will that be enough. I can do another record and send you the code.

If not, what would be the best way to get those headers chain?

With the sole recorder, you’ll only get the requests, but not the responses.

What you can do however is use the recorder and enable DEBUG logging (in logback.xml) so you’ll get the full requests and responses in your console.

Ok, as soon as I get to work, I will record it with debug and send it you.

Would be great, thanks a lot!

One more thing. Can I send the console output to log file. Recorder creates lot of data, it will be easy to just capture it in a log file.

Yes, you have to replace the ConsoleAppender by a FileAppender in logback.xml.
http://logback.qos.ch/manual/appenders.html

I have attached the recorder logs and run logs. Let me know if you need anything else.

RunSimulation - recorded Script.log (334 KB)

Recorder-testfile.log (39.7 KB)

RecordedSimulation.scala (37 KB)

I have attached the recorder logs and run logs. Let me know if you need anything else.

RunSimulation - recorded Script.log (334 KB)

Recorder-testfile.log (39.7 KB)

RecordedSimulation.scala (37 KB)

Adding my modified script and server logs.

MySimulation.scala (1.16 KB)

MySimulation-Rull.log (3.02 KB)

Sorry, that’s not sufficient :frowning:

In your logs, there seems to be only the Type3 message, and it resulted in a 401, not 200.
And you didn’t provide your credentials, domain and host.

I understand that those information are private, but I can’t really do anything without those.
I fear we’ve reached a dead end.

The problem that you don't have a way to test your code. What if we get a environment. Microsoft Azure provides iis and AD services. Will that help?

I guess so, yes. If you can help with the Windows set up too.