[cas-dev] JASIG CAS Client for Java 3.1.0-RC1 - how to access User ID
Alar
ng at wbgrupp.net
Fri Jan 4 09:50:08 EST 2008
Thanks for the fast reply.
I tried out these instructions, but I'm still in trouble. I just added
filter to web.xml in following way:
---
<filter>
<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
<filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
---
I can see with debugger that this filter is accessed when I'm
redirected back from login screen to my application, but in
HttpServletRequestWrapperFilter.java
at doFilter(..) the principal is null as well as assertion is null
inside retrievePrincipalFromSessionOrRequest ()
And therefore getRemoteUser() returns also null later on.
I also tried out AssertionThreadLocalFilter, but result is similar.
Just for remark: I run this Tapestry 4 based application with Jetty
5.x - but I hope this is not disturbing CAS.
Thanks in advance,
Alar
2008/1/4, Scott Battaglia <scott.battaglia at gmail.com>:
> Alar,
>
> Yes, the JASIG CAS Client for Java 3.1 has a
> HttpServletRequestWrapperFilter:
> http://www.ja-sig.org/wiki/display/CASC/Configuring+the+JA-SIG+CAS+Client+for+Java+in+the+web.xml
>
> You can use that to access either the Principal object or the remote user.
> You can also use the AssertionThreadLocalFilter to make the Assertion
> available anywhere in your application.
>
> -Scott
>
>
> On Jan 4, 2008 12:18 AM, Alar <ng at wbgrupp.net> wrote:
> >
> > I can not figure out how to access User ID from java code after
> > successful login.
> >
> > There is HttpServletRequestWrapperFilter example in
> >
> >
> http://www.ja-sig.org/products/cas/client/client-java/index.html
> >
> > but I'm not sure if is can be applied to client version 3.1
> >
> >
> > Thanks for tips!
> > _______________________________________________
> > cas-dev mailing list
> > cas-dev at tp.its.yale.edu
> > http://tp.its.yale.edu/mailman/listinfo/cas-dev
> >
>
>
>
> --
> -Scott Battaglia
>
> LinkedIn: http://www.linkedin.com/in/scottbattaglia
> _______________________________________________
> cas-dev mailing list
> cas-dev at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas-dev
>
>
More information about the cas-dev
mailing list