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


##########
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 if "basic" is set as the first option, it will automatically 
enable the basic login function.What is this WEB_LOGIN_HEADER for?



-- 
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