Skip to content

Commit 8ebfbf3

Browse files
committed
Adjust comment from third-party PR
1 parent 36b7490 commit 8ebfbf3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/HttpListener.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,9 @@ class HttpListener {
2626

2727
void startListener(int port, HttpHandler httpHandler) {
2828
try {
29-
// since we only allow loopback address, we can use InetAddress.getLoopbackAddress() directly
30-
// why? because currently we are creating Socket using InetSocketAddress(port)
31-
// which is using wildcard address, so it will attempt to bind to all available network interfaces
32-
// that includes private IP like 192.168.x.x, 10.x.x.x, etc.
33-
// which in turns, will trigger the firewall prompt
29+
//Originally this created a listener on the wildcard address from InetSocketAddress(port), which could cause firewall issues:
3430
// https://github.com/AzureAD/microsoft-authentication-library-for-java/issues/796
31+
//Since only loopback addresses are allowed for the flow that uses this listener, we now just use the loopback address instead
3532
server = HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), port), 0);
3633
server.createContext("/", httpHandler);
3734
this.port = server.getAddress().getPort();

0 commit comments

Comments
 (0)