You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@druid.apache.org by GitBox <gi...@apache.org> on 2018/07/20 19:28:46 UTC

[GitHub] leventov commented on a change in pull request #5856: Immediately send 401 on basic HTTP authentication failure

leventov commented on a change in pull request #5856: Immediately send 401 on basic HTTP authentication failure
URL: https://github.com/apache/incubator-druid/pull/5856#discussion_r204147376
 
 

 ##########
 File path: extensions-core/druid-basic-security/src/main/java/io/druid/security/basic/authentication/BasicHTTPAuthenticator.java
 ##########
 @@ -175,6 +182,9 @@ public void doFilter(
       if (checkCredentials(user, password)) {
         AuthenticationResult authenticationResult = new AuthenticationResult(user, authorizerName, name, null);
         servletRequest.setAttribute(AuthConfig.DRUID_AUTHENTICATION_RESULT, authenticationResult);
+      } else {
+        httpResp.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+        return;
 
 Review comment:
   @jon-wei if this return is intentional, would be clearer to move the line `filterChain.doFilter(servletRequest, servletResponse);` from under the `if` block into the first branch.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@druid.apache.org
For additional commands, e-mail: dev-help@druid.apache.org