Skip to content

Update ntlm-authentication.js#1500

Open
Alankarsharma wants to merge 1 commit into
http-party:masterfrom
Alankarsharma:patch-3
Open

Update ntlm-authentication.js#1500
Alankarsharma wants to merge 1 commit into
http-party:masterfrom
Alankarsharma:patch-3

Conversation

@Alankarsharma
Copy link
Copy Markdown

Earlier example was working well when the requests were hitting the proxy in sequential manner. But in case of multiple parallel authentication requests it fails intermittently.
Default “getName” function of NodeJS Agent class considers the hostname and port number of backend server to decide whether to reuse an existing connection or create a new connection. As all the request go to one server only one single connection (In case of load connection never expires) is created for all the requests from proxy to server. This causes an issue in NTLM authentication, as NTLM is a challenge/response authentication, one client may be sending its first request ( to which server will respond with challenge) and at same time other might send response to the challenge, as single connection is used to send all the data to server, server rejects both the request and client gets unauthorised response.
Considering from which client the request is coming and creating a different connection based on the client solves this problem.

Earlier example was working well when the requests were hitting the proxy in sequential manner. But in case of multiple parallel authentication requests it fails intermittently.
Default “getName” function of NodeJS Agent class considers the hostname and port number of backend server to decide whether to reuse an existing connection or create a new connection. As all the request go to one server only one single connection (In case of load connection never expires) is created for all the requests from proxy to server. This causes an issue in NTLM authentication, as NTLM is a challenge/response authentication, one client may be sending its first request ( to which server will respond with challenge) and at same time other might send response to the challenge, as single connection is used to send all the data to server, server rejects both the request and client gets unauthorised response.
Considering from which client the request is coming and creating a different connection based on the client solves this problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant