-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSAL Node - HttpClient Proxy Improvements #6987
Conversation
@@ -72,6 +78,7 @@ export class HttpClient implements INetworkModule { | |||
this.proxyUrl, | |||
HttpMethod.POST, | |||
options, | |||
this.customAgent as http.Agent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the customer configured https.Agent? Should you not throw an exception with a good error message explaining how to configure these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some improvements to address this.
Take a look at this stack overflow post.
https.Agent internally calls and constructs with http.Agent
I interpret this as meaning either one can be used. Look at my improvements and let me know your thoughts.
@@ -80,6 +87,7 @@ export class HttpClient implements INetworkModule { | |||
url, | |||
HttpMethod.POST, | |||
options, | |||
this.customAgent as https.Agent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this work with MSI? Calls to MSI are done over http.
I don't expect anyone to define a proxy for calling MSI. That can be unsupported scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My improvements should address this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this is not unit testable, but please explain how you manually tested this?
I'll be testing this shortly on my Windows laptop with Fiddler, to simulate a proxy. I'm also going to to ask the user who filed the linked issue to test this. |
Added
customAgent
to msal-node system options so custom http(s) agents can be used by the HttpClient. This allows devs to use agents created by third party libraries (useful for proxy support).Added support for authenticated proxy.
NOTE: faq.md was automatically linted. The only change is on line 75.