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:
@roryqi When the user enters an incorrect password, a pop-up window will
appear on the browser. Do you think this is the correct scenario? If this
behavior is to be corrected, the code in the backend needs to be modified. (The
modified logic is to add a special judgment. If the browser calls the backend
interface and encounters a 401 error, the response will not set the header.)
--
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]