"shahab" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 




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

Reply via email to