tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Jennings" <southgate.softw...@home.com>
Subject Re: per-context realms
Date Thu, 07 Jun 2001 15:54:40 GMT
Thanks!
That is EXACTLY what I was looking for!

-Mike


----- Original Message ----- 
From: "Antony Bowesman" <adb@teamware.com>
To: <tomcat-dev@jakarta.apache.org>
Sent: Wednesday, June 06, 2001 10:39 PM
Subject: Re: per-context realms


> Michael Jennings wrote:
> > 
> > Hi everyone,
> > 
> > Does anyone have an idea of how I could go about implementing
> > realms/authentication on a per-context basis?
> > Ideally, what I would like to do is have each context control
> > their users and roles. Where should I look to get a clue?
> 
> Make a simple realm implementation that simply gets the real realm
> config information from the context passed with the request, e.g.
> 
> authenticate(Req)
> {
>    Context ctx = req.getContext();
> 
>    // Now you have all the context config available
> ..
> }
> 
> I have a JAAS realm which has context specific realm config using the
> 
>   <context-param>
>     <param-name>Name</param-name>
>     <param-value>Value</param-value>
>   </context-param>
> 
> attributes in web.xml to provide context specific control.
> 
> In the realm, just so
> 
>    String ctxNameValue = ctx.getInitParameter("Name");
> 
> or similar.  With JAAS this is easy, because JAAS allows for different
> JAAS configurations to be used, you just specify a different config name
> to the JAAS context.
> 
> Antony


Mime
View raw message