Fix excluded path config behavior

This commit is contained in:
Nishant 2018-04-09 20:05:19 +05:30
parent 07f2e1e398
commit 3901047769
1 changed files with 6 additions and 0 deletions

View File

@ -230,6 +230,12 @@ public class KerberosAuthenticator implements Authenticator
String path = ((HttpServletRequest) request).getRequestURI(); String path = ((HttpServletRequest) request).getRequestURI();
if (isExcluded(path)) { if (isExcluded(path)) {
// For excluded paths that does NOT need to be autheticated.
// set authenticated username as Anonymous
request.setAttribute(
AuthConfig.DRUID_AUTHENTICATION_RESULT,
new AuthenticationResult(AuthenticationToken.ANONYMOUS.getName(), authorizerName, null)
);
filterChain.doFilter(request, response); filterChain.doFilter(request, response);
} else { } else {
String clientPrincipal = null; String clientPrincipal = null;