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/06/13 15:41:34 UTC

how to populate userPrincipal in request object

Hi:

Would you please let me know how can I set the userPrincipal in request
Object. 
I am setting the Principal and roles in Subject (2 Principal object
according to JAAS implementation).

When i run the code in debugger, I see the Subject in "reuqest" null, also
userPrincipal is null. Also, instead of role map in "request", its updating
security map.

Thanx
-- 
View this message in context: http://www.nabble.com/how-to-populate-userPrincipal-in-request-object-tf3914736.html#a11099625
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 populate userPrincipal in request object

Posted by Mark Claassen <mc...@ocie.net>.
I am not sure what your exact situation here is, but the user certificate
stuff is only available if Tomcat requests it.  And Tomcat only does this if
Tomcat is using certificate based SSL authentication.  I don't believe this
will work if an Apache webserver is handling the SSL negotiation.

Mark
 
-----Original Message-----
From: shahab [mailto:smahtab@pershing.com] 
Sent: Wednesday, June 13, 2007 9:42 AM
To: users@tomcat.apache.org
Subject: how to populate userPrincipal in request object


Hi:

Would you please let me know how can I set the userPrincipal in request
Object. 
I am setting the Principal and roles in Subject (2 Principal object
according to JAAS implementation).

When i run the code in debugger, I see the Subject in "reuqest" null, also
userPrincipal is null. Also, instead of role map in "request", its updating
security map.

Thanx
--
View this message in context:
http://www.nabble.com/how-to-populate-userPrincipal-in-request-object-tf3914
736.html#a11099625
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


---------------------------------------------------------------------
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 populate userPrincipal in request object

Posted by Bill Barker <wb...@wilshire.com>.
"shahab" <sm...@pershing.com> wrote in message 
news:11105770.post@talk.nabble.com...
>
> Hi:
>
> I am trying to find out how to poulate the userPrincipal from
> HttpServletRequest.
>
> I have the following code to retrieve the principal -
> HttpServletRequest request = ServletActionContext.getRequest();
> Principalprincipal = request.getUserPrincipal(); // get a Principal object
>
> My qn is to how to set the userPrincipal.

The easiest way is to write a HttpServletRequestWrapper that overrides the 
getUserPrincipal method and returns the Principal you want to use. 
Otherwise, you can't do it from Servlet code.  You would have to write a 
Valve that would have access to Tomcat's internal Request object and could 
set it there.

>
> thanx
>
>
>
> shahab wrote:
>>
>> Hi:
>>
>> Would you please let me know how can I set the userPrincipal in request
>> Object.
>> I am setting the Principal and roles in Subject (2 Principal object
>> according to JAAS implementation).
>>
>> When i run the code in debugger, I see the Subject in "reuqest" null, 
>> also
>> userPrincipal is null. Also, instead of role map in "request", its
>> updating security map.
>>
>> Thanx
>>
>
> -- 
> View this message in context: 
> http://www.nabble.com/how-to-populate-userPrincipal-in-request-object-tf3914736.html#a11105770
> 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
>
> 




---------------------------------------------------------------------
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 populate userPrincipal in request object

Posted by shahab <sm...@pershing.com>.
Hi:

I am trying to find out how to poulate the userPrincipal from
HttpServletRequest.

I have the following code to retrieve the principal - 
HttpServletRequest request = ServletActionContext.getRequest();
Principalprincipal = request.getUserPrincipal(); // get a Principal object

My qn is to how to set the userPrincipal.

thanx



shahab wrote:
> 
> Hi:
> 
> Would you please let me know how can I set the userPrincipal in request
> Object. 
> I am setting the Principal and roles in Subject (2 Principal object
> according to JAAS implementation).
> 
> When i run the code in debugger, I see the Subject in "reuqest" null, also
> userPrincipal is null. Also, instead of role map in "request", its
> updating security map.
> 
> Thanx
> 

-- 
View this message in context: http://www.nabble.com/how-to-populate-userPrincipal-in-request-object-tf3914736.html#a11105770
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