@Override
  public boolean shouldApply(HttpServletRequest httpServletRequest) {
    boolean shouldApply = false;

    JwtAuthenticationProperties jwtProperties = propertiesProvider.get();
    if (jwtProperties != null && jwtProperties.isEnabledForAmbari()) {
      String serializedJWT = getJWTFromCookie(httpServletRequest);
      shouldApply = (serializedJWT != null && isAuthenticationRequired(serializedJWT));
    }

    return shouldApply;
  }
Tests to see if this JwtAuthenticationFilter shold be applied in the authentication
filter chain.

<code>true</code> will be returned if JWT authentication is enabled and the HTTP request contains
a JWT authentication token cookie; otherwise <code>false</code> will be returned.

@param httpServletRequest the HttpServletRequest the HTTP service request
@return <code>true</code> if the HTTP request contains the basic authentication header; otherwise <code>false</code>
ambari-server/src/main/java/org/apache/ambari/server/security/authentication/jwt/AmbariJwtAuthenticationFilter.java