webtier@glassfish.java.net

Re: [webtier] Retrieving Logged in users security roles

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Mon, 27 Jul 2009 10:46:13 -0700

HttpServletRequest.isUserInRole(String role)

But we're not really security people here - have you tried
users_at_glassfish.dev.java.net?

Jim

On 7/27/09 5:41 AM, webtier_at_javadesktop.org wrote:
> Good Morning,
> I have spent the better part of two days trying to find the answer to this problem but I am unable to find anything. I might be searching on the wrong terms because it seems like a pretty basic question. Any help you can provide would be greatly appreciated.
>
> I have a Web application running in Glassfish 2.1. I am currently using form based login with the Glassfish's file-realm (planning on creating/using a LDAP realm for production). Once a users logs in, I am able to retrieve the username using this code:
> [i]
> FacesContext fc = FacesContext.getCurrentInstance();
> String username = fc.getExternalContext().getRemoteUser();[/i]
>
> However, I also need to retrieve the users security roles (group list). For example, if the user is part of the TechAdmin, TechManagement, and TechUser security roles, I would like to be able to retrieve that a list containing those group (security role) names.
>
> Is this possible?
> Thanks in advance for any help you can provide.
>
> Jon
> [Message sent by forum member 'hoffmanjon' (hoffmanjon)]
>
> http://forums.java.net/jive/thread.jspa?messageID=357680
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>