tuteng commented on a change in pull request #14044:
URL: https://github.com/apache/pulsar/pull/14044#discussion_r798603429



##########
File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/web/AuthenticationFilter.java
##########
@@ -74,10 +77,24 @@ public void doFilter(ServletRequest request, 
ServletResponse response, FilterCha
 
             if (!isSaslRequest(httpRequest)) {
                 // not sasl type, return role directly.
-                String role = 
authenticationService.authenticateHttpRequest((HttpServletRequest) request);
+                String authMethodName = 
httpRequest.getHeader(PULSAR_AUTH_METHOD_NAME);
+                AuthenticationState authenticationState = null;
+                if (authMethodName != null && 
authenticationService.getAuthenticationProvider(authMethodName) != null) {
+                    authenticationState = authenticationService
+                            
.getAuthenticationProvider(authMethodName).newHttpAuthState(httpRequest);
+                    request.setAttribute(AuthenticatedDataAttributeName, 
authenticationState.getAuthDataSource());
+                } else {
+                    request.setAttribute(AuthenticatedDataAttributeName,

Review comment:
       Backward compatible




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