I am trying to cas clear pass working with just an HttpServlet,  Nothing
fancy, no jsp at this time.  I implemented the filters because it seems
like the java client library is geared towards using them and i also
found a mywebapp.war that kind of illustrates getting a proxy ticket. 
Every time i do the fallowing i get result = null.

        Assertion assertion = AssertionHolder.getAssertion();
       
        AttributePrincipal principal = assertion.getPrincipal();
       
        String targetService = "https://localhost:8443/cas/clearPass";;
        String result = principal.getProxyTicketFor(targetService);

Any Ideas?

Alexander Barker
Senior Programmer
California Lutheran University
Information Systems and Services
60 West Olsen Road
Thousand Oaks, CA 91360
805.493.3912


On 01/30/2010 07:50 AM, Scott Battaglia wrote:
> From just the regular Jasig CAS Client, if you've enabled the wrapping
> filter, just do:
>
> final AttributePrincipal attributePrincipal = (AttributePrincipal)
> request.getPrincipal():
> attributePrincipal.getPRoxyTicketFor(url)
>
> Cheers,
> Scott
>
>
> On Fri, Jan 29, 2010 at 5:14 PM, Leena Borle <[email protected]
> <mailto:[email protected]>> wrote:
>
>     Hi,
>     If you are using cas3 with spring security,
>
>     import org.springframework.security.context.SecurityContextHolder;
>     import org.springframework.security.context.SecurityContext;
>     import
>     org.springframework.security.providers.cas.CasAuthenticationToken;
>     import  org.jasig.cas.client.validation.Assertion;
>
>        public static String  getProxyTicketForService(String url) {
>             String  proxyTicket  = null;
>             SecurityContext ctx = SecurityContextHolder.getContext();
>             if (ctx.getAuthentication() != null) {
>                 CasAuthenticationToken auth = (CasAuthenticationToken)
>     ctx.getAuthentication();
>                 Assertion assertion = auth.getAssertion();
>                 proxyTicket =
>     assertion.getPrincipal().getProxyTicketFor(url);
>             }
>             return proxyTicket;
>         }
>
>      Is this what you are looking for ?
>     Leena
>     On Fri, Jan 29, 2010 at 8:29 AM, Alex Barker
>     <[email protected] <mailto:[email protected]>> wrote:
>
>         Does anyone have or know where I can find java code
>         illustrating how to
>         obtain a proxy granting ticket (pgt) for CAS3?  All the
>         information on
>         the subject appears to target the yale release using classes
>         that no
>         longer exist.
>
>         Thanks
>
>         --
>
>         Alexander Barker
>         Senior Programmer
>         California Lutheran University
>         Information Systems and Services
>         60 West Olsen Road
>         Thousand Oaks, CA 91360
>         805.493.3912
>
>
>         --
>         You are currently subscribed to [email protected]
>         <mailto:[email protected]> as: [email protected]
>         <mailto:[email protected]>
>
>         To unsubscribe, change settings or access archives, see
>         http://www.ja-sig.org/wiki/display/JSG/cas-user
>
>
>     -- 
>     You are currently subscribed to [email protected] 
> <mailto:[email protected]> as: [email protected] 
> <mailto:[email protected]>
>
>
>     To unsubscribe, change settings or access archives, see 
> http://www.ja-sig.org/wiki/display/JSG/cas-user
>
>
> -- 
> You are currently subscribed to [email protected] as: 
> [email protected]
> To unsubscribe, change settings or access archives, see 
> http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to