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



##########
File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/web/AuthenticationFilter.java
##########
@@ -76,8 +77,15 @@ public void doFilter(ServletRequest request, ServletResponse 
response, FilterCha
                 // not sasl type, return role directly.
                 String role = 
authenticationService.authenticateHttpRequest((HttpServletRequest) request);
                 request.setAttribute(AuthenticatedRoleAttributeName, role);
-                request.setAttribute(AuthenticatedDataAttributeName,
-                    new AuthenticationDataHttps((HttpServletRequest) request));
+                String authMethodName = 
httpRequest.getHeader("X-Pulsar-Auth-Method-Name");
+                if (authMethodName != null && 
authenticationService.getAuthenticationProvider(authMethodName) != null) {
+                    AuthenticationState authenticationState = 
authenticationService
+                            
.getAuthenticationProvider(authMethodName).newHttpAuthState(httpRequest);
+                    request.setAttribute(AuthenticatedDataAttributeName, 
authenticationState.getAuthDataSource());

Review comment:
       Got it, thanks.




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