tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Gierke <>
Subject Re: Possible to expose a Tomcat Realm instance through JNDI ?
Date Wed, 12 Jun 2013 06:11:15 GMT
> Hash: SHA256
> Tobias,
> On 6/11/13 11:20 AM, Tobias Gierke wrote:
>> In my web app, I'd like to re-use the (server-wide) Tomcat Realm
>> that is already being used for HTTP Basic authentication but
>> couldn't find a way how to get hold of the actual Realm instance.
>> I spent quite some time looking for a solution (complicated by the
>> fact that most Google hits actually referred to the LDAP
>> authentication realm) but found none. Is  there a
>> "config-file-only" solution or do I need to dig into the Tomcat
>> source code and come up with my own JNDI ObjectFactory to achieve
>> this ?
> What are you actually trying to accomplish? Do you want to
> authenticate a user, or get information about an authenticated user?
I need to retrieve the roles assigned to the current (authenticated) 
user. I now solved this by simply using 
WebServiceContext#getUserPrincipal() (inside a JAX-WS webservice 
published by Spring) and downcasting the result to org.apache.catalina.User.


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

View raw message