@Override
  public boolean shouldApply(HttpServletRequest httpServletRequest) {
    if (LOG.isDebugEnabled()) {
      RequestUtils.logRequestHeadersAndQueryParams(httpServletRequest, LOG);
    }

    if (kerberosAuthenticationEnabled) {
      String header = httpServletRequest.getHeader("Authorization");
      return (header != null) && (header.startsWith("Negotiate ") || header.startsWith("Kerberos "));
    } else {
      return false;
    }
  }
Tests to determine if this authentication filter is applicable given the Ambari configuration
and the user's HTTP request.
<p>
If the Ambari configuration indicates the Kerberos authentication is enabled and the HTTP request
contains the appropriate <code>Authorization</code> header, than this filter may be applied;
otherwise it should be skipped.

@param httpServletRequest the request
@return true if this filter should be applied; false otherwise
ambari-server/src/main/java/org/apache/ambari/server/security/authentication/kerberos/AmbariKerberosAuthenticationFilter.java