You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by shahab <sm...@pershing.com> on 2007/04/25 06:05:34 UTC

how to set JAAS Subject in HTTPSession

Hi:

I would need help with the following -
I am trying to implement JAAS authentication using struts2. I have
implemented the following flow -
user request -> struts action -> login() -> loginModule (implements
LoginModule)

this login module validates userid, password and  in the commit(), it
creates a Principal and adds the principal in the Subject.

My qn is how do I set this Subject in the HttpSession so that I can retrieve
it later, like below -
HttpServletRequest request = ServletActionContext.getRequest();
Principal principal = request.getUserPrincipal();


Please help.
thanx
Shahahb
-- 
View this message in context: http://www.nabble.com/how-to-set-JAAS-Subject-in-HTTPSession-tf3642977.html#a10173947
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: how to set JAAS Subject in HTTPSession

Posted by Rashmi Rubdi <ra...@gmail.com>.
Hi shahab,

Here's : http://forum.java.sun.com/category.jspa?categoryID=15 for
JAAS related questions.

To set any object into HTTP Session use the setAttribute method:
http://java.sun.com/javaee/5/docs/api/ , and removeAttribute.

Regards
-Rashmi

On 4/25/07, shahab <sm...@pershing.com> wrote:
>
> Hi:
>
> I would need help with the following -
> I am trying to implement JAAS authentication using struts2. I have
> implemented the following flow -
> user request -> struts action -> login() -> loginModule (implements
> LoginModule)
>
> this login module validates userid, password and  in the commit(), it
> creates a Principal and adds the principal in the Subject.
>
> My qn is how do I set this Subject in the HttpSession so that I can retrieve
> it later, like below -
> HttpServletRequest request = ServletActionContext.getRequest();
> Principal principal = request.getUserPrincipal();
>
>
> Please help.
> thanx
> Shahahb
> --

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org