Fwd: No longer able to use my own org.apache.catalina.authenticator.BasicAuthenticator in Tomcat 8.5.5

2016-10-01 Thread Johannes Michler
Hi,

for our own web-application we overwrite the standard way of how Tomcat
BasicAuthenticator is working in order to avoid the popup of a
"Basic-Auth-Dialog" in some situations (where we're calling a service
provided by the tomcat over a script). Therefore our context.xml in the app
looks as follows:





HorusTomcatBasicAuthenticator is implemented as follows:
public class HorusTomcatBasicAuthenticator extends BasicAuthenticator
implements Authenticator {

@Override
public boolean authenticate( Request request, HttpServletResponse
response) throws IOException {
System.out.println( " start out");
boolean result = super.authenticate( request, response);
System.out.println( " authenticate: " + result);
modifyResponse( request, response);
return result;
}
private void modifyResponse( Request request, HttpServletResponse
response) {
String url = request.getPathInfo();
System.out.println( "XX URL=" + url);
System.out.println( "XX Auth Header:" + response.getHeader(
AUTH_HEADER_NAME));
if ( response.getHeader( AUTH_HEADER_NAME) != null &&
url.startsWith( "/rest"))
response.setHeader( AUTH_HEADER_NAME, "HCP_BASIC");
}

}


This is working great with Tomcat 8.0(.37). Though with Tomcat 8.5.5 that
code in "authenticate" is no longer called. Instead it seams that the
"standard" BasicAuthenticator is being used.

However if I entirely remove my jar-file that contains
HorusTomcatBasicAuthenticator.jar from the tomcat/lib-folder I'm getting an
error.

Any ideas on that? I've looked into the tomcat 8.5 migration guide but
could not find any hints on changed behaviour. Also when comparing the
Valve-Documentation of Tomcat 8.5 and 8.0 I do not see a difference.

Or would it be better to address this with d...@tomcat.apache.org since it
might as well be a bug?

Or is there a more elegant way to solve this problem to not reply with
"WWW-Authenticate: Basic" if authentication is not succesful?

Any help would be highly appreciated,

BR
Johannes



-- 

__
Johannes Michler -- Senior Principal Consultant
PROMATIS software GmbH
Pforzheimer Str. 160
76275 Ettlingen, Deutschland
Tel.: +49 7243 2179 0 -- Fax: +49 7243 2179 99
mailto: johannes.mich...@promatis.de
Knowledge powered business processes: www.promatis.de
[image: Bild]
__

Sitz der Gesellschaft: Ettlingen
Registergericht: Mannheim, HRB 361772
Geschäftsführer: Dr. Frank Schönthaler, Rainer Mann, Michael Mohl
[image: Bild]

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

add mapping for jsp servlet in web.xml?

2016-10-01 Thread Rob Nikander
Hi,

I’m upgrading from Tomcat 6 to Tomcat 8. The web.xml has a mapping like this, 
to use the jsp servlet for all files in a certain directory:


   jsp
   /some-stuff/*
 

In Tomcat 6 this worked, but in 8, this *replaces* the existing mapping from 
the default web.xml (so .jsp files don’t work).

Is there way a simple way to add the mapping, rather than replace existing 
mappings?

thanks,
Rob
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org