Andrew:

I set this on the session so that an Application gets the username later for
authorization reasons.  The application requires that exact property and
it's a proprietary third party app.  You have to parse or extract the user
from the session yourself after you set the remote user.  It's mechanical
yes, but it can be obtained.


 /* (non-Javadoc)
  * @see
org.springframework.web.filter.OncePerRequestFilter#doFilterInternal(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain)
  */
 protected void doFilterInternal(HttpServletRequest request,
   HttpServletResponse response, FilterChain filterChain)
   throws ServletException, IOException {

  if (isAuthenticated(request)) {

   HttpSession session = request.getSession(false);
   String principalName = request.getRemoteUser();
   Principal principal = new UserPrincipal(principalName);
   session.setAttribute("javax.security.auth.principal", principal);

   filterChain.doFilter(request, response);

   return;

  } else {

David

On 11/25/08, Scott Battaglia <[EMAIL PROTECTED]> wrote:
>
> Does Tomcat expose a method for associating with it?
>
> We set the remote user (as long as you enable that filter).  I'm not sure
> what else can be done.
>
> -Scott
>
> -Scott Battaglia
> PGP Public Key Id: 0x383733AA
> LinkedIn: http://www.linkedin.com/in/scottbattaglia
>
>
>  On Tue, Nov 25, 2008 at 12:00 PM, Andrew Ralph Feller, afelle1 <
> [EMAIL PROTECTED]> wrote:
>
>>  QUESTION:
>> Is there a way to register usernames with the servlet container upon
>> service tickets being validated by using the JA-SIG Java CAS client?
>>
>> EXPLANATION:
>> While digging through out application logs, I came to the point where I am
>> fed up not having users' usernames associated with HTTP requests from Tomcat
>> AccessLogValve.  I realize this is because users are only known to the CAS
>> client and haven't been registered with Tomcat.  After users are logged in,
>> we use a custom JAAS module to provide their principals.  I have started
>> looking harder at Spring Security / ACEGI for authorization, but I wanted to
>> see if anyone else has figured this out.
>>
>> Thanks,
>> Andrew
>> --
>> Andrew R. Feller, Analyst
>> Information Technology Services
>> 200 Fred Frey Building
>> Louisiana State University
>> Baton Rouge, LA 70803
>> (225) 578-3737 (Office)
>> (225) 578-6400 (Fax)
>>
>> _______________________________________________
>> Yale CAS mailing list
>> [email protected]
>> http://tp.its.yale.edu/mailman/listinfo/cas
>>
>>
>
> _______________________________________________
> Yale CAS mailing list
> [email protected]
> http://tp.its.yale.edu/mailman/listinfo/cas
>
>
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas

Reply via email to