Thanks for the reply,
I have a weird behaviour, I have specified the following in my context.xml
<Context preemptiveAuthentication="true">
<Valve className="org.apache.tomee.catalina.valve.LazyValve"
delegateClassName="org.superbiz.authenticator.CustomAuthenticator" />
<Realm className="org.apache.tomee.catalina.realm.LazyRealm" cdi="true"
realmClass="org.superbiz.realm.CustomRealm" />
</Context>
My CustomAuthenticator is basically just a copy of the BasicAuthenticator
valve (for testing purposes). What seems weird is that the following code:
Principal principal = context.getRealm().authenticate(username, password);
authenticates with the CombinedRealm and not my own CustomRealm ?!?
I also commented out the login-config section of the web.xml.

What I am trying to do is basically have my own custom authenticator which
would authenticate via my custom realm without having to alter the tomcat
install or deploy other custom jars within tomcat ...

Any help would be appreciated
Thanks in advance



Patrick Sansoucy
In theory, there is no difference between theory and practice, but in
practice, there is ...

On Tue, Nov 17, 2015 at 10:46 PM, Romain Manni-Bucau <[email protected]>
wrote:

> Hi Patrick,
>
> you dont need to update this file if you just add an Authenticator in
> context.xml/server.xml. It is only used for built in authenticator
> method referenced in web.xml.
> A custom authenticator wouldnt have the associated config in web.xml
> so not sure what would be your plan then.
>
> Did i get it right?
>
>
> Romain Manni-Bucau
> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>
>
> 2015-11-17 19:34 GMT-08:00 Patrick Sansoucy <[email protected]>:
> > Hello,
> >
> > I am in the process of writing a custom authenticator valve and most of
> the
> > sties I stumbled upon all point to modifying the
> > Authenticators.properties files
> > within the catalina.jar. I really want to avoid tempering with the
> > tomee/tomcat install in place, is there any other way to add a custom
> type
> > of authenticator. The best case scenario would be to have it setup via a
> > LazyValve but I doubt it is something available currently ...
> >
> > Thanks for the info
> >
> > Patrick Sansoucy
> > In theory, there is no difference between theory and practice, but in
> > practice, there is ...
>

Reply via email to