Figured out, the cookie is secure, so it is only sent via TLS. I was
running CAS on Plain HTTP.
Yan
On Tuesday, September 25, 2018 at 2:54:17 PM UTC-4, Yan Zhou wrote:
>
> 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();
>
> }
>
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/f02911f6-483b-4300-b2aa-9e6abc365cdc%40apereo.org.