You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pierre-Laurent Ribault <ri...@ist.fujitsu.com> on 2002/12/24 02:48:44 UTC

Servlet API: how to obtain the roles list ?

Hi,

I want to obtain the list of the roles defined in the system from inside
 my servlet. I know where the roles are defined, and that I can check
the user name and isUserInRole from the HttpServletRequest class, but I
could not find out a method to list the existing users or roles. Is
there such a method in the servlet API ?

Pierre-Laurent Ribault
ribault@ist.fujitsu.com










--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Servlet API: how to obtain the roles list ?

Posted by Gary Gwin <to...@cafesoft.com>.
Pierre,

There is no way to do this using the servlet API but you could easily 
store your user and role information in a JDBC user repository and then 
query that repository for the user data you want. If you need to include 
the user repository with your webapp, we've used the Hypersonic SQL 
database.

Gary

Pierre-Laurent Ribault wrote:

>Hi,
>
>I want to obtain the list of the roles defined in the system from inside
> my servlet. I know where the roles are defined, and that I can check
>the user name and isUserInRole from the HttpServletRequest class, but I
>could not find out a method to list the existing users or roles. Is
>there such a method in the servlet API ?
>
>Pierre-Laurent Ribault
>ribault@ist.fujitsu.com
>
>
>
>
>
>
>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>  
>

-- 

Gary Gwin
CEO and Founder
Cafesoft
858.455.1800 x205
http://www.cafesoft.com

*****************************************************************
*                                                               *
*   The Cafesoft Access Management System, Cams, is security    *
*   software that provides single sign-on authentication and    *
*   centralized access control for Apache, Tomcat, and custom   *
*   resources.                                                  *
*                                                               *
*****************************************************************



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Servlet API: how to obtain the roles list ?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 24 Dec 2002, Pierre-Laurent Ribault wrote:

> Date: Tue, 24 Dec 2002 10:48:44 +0900
> From: Pierre-Laurent Ribault <ri...@ist.fujitsu.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: Servlet API: how to obtain the roles list ?
>
> Hi,
>
> I want to obtain the list of the roles defined in the system from inside
>  my servlet. I know where the roles are defined, and that I can check
> the user name and isUserInRole from the HttpServletRequest class, but I
> could not find out a method to list the existing users or roles. Is
> there such a method in the servlet API ?

At best, you'll be able to identify the security roles that *this* web
application is interested in, by parsing the "/WEB-INF/web.xml" resource
yourself, looking for <security-role> elements.

It is perfectly reasonable to utilize authentication and authorization
schemes (in a servlet container) that are not capable of enumerating all
valid users or all valid roles.  Therefore, there is no portable servlet
API to access such information.

>
> Pierre-Laurent Ribault
> ribault@ist.fujitsu.com

Craig McClanahan



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>