CAS 5.3, how to get TGT?

51 views
Skip to first unread message

Yan Zhou

unread,
Sep 25, 2018, 2:54:17 PM9/25/18
to CAS Community
Hello,

I need to extend my overlay of CAS 5.3.3, to support an additional endpoint.

MyController looks like this.  User login to CAS already. I want to get the authenticated user Id when user comes to this endpoint.

But, I am unable to get TGT below.  What would be the right approach?

Thx!
Yan

@Autowired
CookieRetrievingCookieGenerator ticketGrantingTicketCookieGenerator;
        @Autowired
        private TicketRegistry ticketRegistry;

@RequestMapping(value = "/xyz", method = RequestMethod.GET)
public ModelAndView doSomething(HttpServletRequest httpRequest) {

TicketGrantingTicket ticket = CookieUtils.getTicketGrantingTicketFromRequest(ticketGrantingTicketCookieGenerator, ticketRegistry, httpRequest);
Principal principal = ticket.getAuthentication().getPrincipal();

         }

Yan Zhou

unread,
Sep 25, 2018, 4:14:31 PM9/25/18
to CAS Community
Figured out, the cookie is secure, so it is only sent via TLS.  I was running CAS on Plain HTTP.

Yan
Reply all
Reply to author
Forward
0 new messages