lasdf1234 commented on code in PR #11812:
URL: https://github.com/apache/gravitino/pull/11812#discussion_r3576696773


##########
server-common/src/main/java/org/apache/gravitino/server/authentication/AuthenticationFilter.java:
##########
@@ -41,15 +41,21 @@
 import org.apache.gravitino.utils.PrincipalUtils;
 
 public class AuthenticationFilter implements Filter {
-
-  private final List<Authenticator> filterAuthenticators;
+  private static final String WEB_LOGIN_HEADER = "X-Gravitino-Web-Login";
 
   /**
    * The matcher used to identify health check paths that bypass 
authentication. Subclasses may
    * replace this with a server-specific matcher (e.g. {@code 
IcebergHealthCheckPathMatcher}).
    */
   protected HealthCheckPathMatcher healthCheckMatcher = new 
HealthCheckPathMatcher();
 
+  private final List<Authenticator> filterAuthenticators;
+  // Skip HTTP challenge for Web UI login requests to avoid the browser's 
native Basic auth popup.
+  private boolean isWebLoginRequest(ServletRequest request) {
+    return request instanceof HttpServletRequest
+        && "true".equalsIgnoreCase(((HttpServletRequest) 
request).getHeader(WEB_LOGIN_HEADER));
+  }
+

Review Comment:
   @Octavi00 After my research, I found that a better solution is that for 
basic authentication, if the status code is 401, then there should be no 
headers in the response.
   Can you modify the Java code according to this logic?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to