PyAuthenNTLM2 icon indicating copy to clipboard operation
PyAuthenNTLM2 copied to clipboard

"Unexpected NTLM message Type 3 in new connection" for POST requests after several seconds

Open Woodham opened this issue 12 years ago • 8 comments

I get the a "Unexpected NTLM message Type 3 in new connection" error when executing a POST request after an indeterminate amount of time on the same page.

The browser then requests a username and password, which doesn't work. (It just keeps requesting a username and password, and clicking cancel gives an unauthorized response).

This happens in Chrome, IE and Firefox.

GET requests all seem to work fine, however long you remain on the page before navigating to another one.

Example from logs:

[Thu Nov 08 10:11:42 2012] [info] [client 10.2.2.58] PYNTLM: Handling connection 0x4 from address 10.2.2.58 for POST URI /admin/general. 0 entries in connection cache., referer: http://iqa/admin/general [Thu Nov 08 10:11:42 2012] [info] [client 10.2.2.58] PYTNLM: Spurious authentication request on connection 0x4. Method = POST. Content-Length = 0. Headers = {OMITTED} [Thu Nov 08 10:11:42 2012] [info] [client 10.2.2.58] Unexpected NTLM message Type 3 in new connection from address 10.2.2.58 and URI /admin/general, referer: http://iqa/admin/general

Woodham avatar Nov 08 '12 10:11 Woodham

I'm having the same problem with POST request, there is a workaround or something in where I can help? traceback, logs, etc?

nueces avatar Nov 20 '12 16:11 nueces

Same problem here. Did either one of you manage to solve it?

ghost avatar Mar 04 '13 09:03 ghost

Same problem .... :/

aliloubm avatar Apr 02 '13 12:04 aliloubm

line 405 of pyntlm.py change

        if req.method!='POST' or req.clength>0:
            return apache.OK   

to return apache.OK #if req.method!='POST' or req.clength>0:

I don't think it's a good idea but It works, just like that!

aliloubm avatar Apr 02 '13 13:04 aliloubm

I have same problem for post with absolute path.

ex. <form action="https://intranet/groups/create/step/group-details/" method="post">
Relative path is ok: 
<form action="/" method="post">

JosefJezek avatar Jun 14 '13 12:06 JosefJezek

Same problem here, hack by @aliloubm "solves" the problem ...

mburtscher avatar Nov 19 '13 11:11 mburtscher

It solved my problem, thanks for the hint. However, this is really out of my comfort zone, someone should make a correct solution and feed it back to the repository. :(

akovacs123 avatar Jun 28 '16 07:06 akovacs123

I used to see a similar issue with POSTs on mod_ntlm, it's down to how IE handles them, see for example: http://pinetik.blogspot.co.uk/2014/12/ie-post-empty-with-ntlm.html https://www.sencha.com/forum/showthread.php?16086-NTLM-authentication-affects-IE-s-posting-capability http://www.websina.com/bugzero/kb/browser-ie.html

peternewman avatar Feb 19 '17 19:02 peternewman