Update ntlm-authentication.js#1500
Open
Alankarsharma wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.