tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Meyer <>
Subject Re: Add custom Authenticator in context.xml
Date Mon, 06 Jul 2020 20:02:03 GMT
Am 6. Juli 2020 14:14:59 MESZ schrieb Mark Thomas <>:
>On 04/07/2020 19:54, Thomas Meyer wrote:
>> Hi,
>> a while ago I did write a little POC of how to add a custom
>> authenticator scheme to tomcat.
>> this is what I did come up with:
>> It's rather complicated solution!
>> Is there an more easy solution to add a custom authenticator scheme
>to a Context/context.xml? 
>How about:
>1. Extract the file from catalina.jar
>   (or from source)
>2. Edit it to reference the custom Authenticator
>3. Place it at $CATALINA_BASE/lib/org/apache/catalina/startup
>4. Add the JAR with the custom authenticator to $CATALINA_BASE/lib
>which would make it generally available to use in WEB-INF/web.xml

Okay, understand! Nice trick.

>1. Add it directly to context.xml as:
>   <Valve
>className="de.m3y3r.catalina.authenticator.BearerTokenAuthenticator" />

Ah, okay an Authenticator is also a Valve, I didn't think about this!

I will play around with this setup a bit. thanks for the hint!

>which you would need to do for each app that wants to use it (or set it
>in the global web.xml for all apps).
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message