class AuthFilter extends AuthenticationFilter {

  @Override
  protected Properties getConfiguration(String prefix, FilterConfig config)
      throws ServletException {
    final Properties p = super.getConfiguration(CONF_PREFIX, config);
    // set authentication type
    p.setProperty(AUTH_TYPE, UserGroupInformation.isSecurityEnabled() ?
        KerberosAuthenticationHandler.TYPE : PseudoAuthenticationHandler.TYPE);
    // if not set, enable anonymous for pseudo authentication
    if (p.getProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED) == null) {
      p.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED, "true");
    }
    //set cookie path
    p.setProperty(COOKIE_PATH, "/");
    return p;
  }

}