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();
}