first, i get the username is because i wan do some my logic when user
logout.
so in my development, i created CustomTerminateSessionAction ,
injected TicketRegistry .
public Event terminate(final RequestContext context) {
// in login's webflow : we can get the value from context as it has
already been stored
String tgtId = WebUtils.getTicketGrantingTicketId(context);
// for logout, we need to get the cookie's value
if (tgtId == null) {
final HttpServletRequest request =
WebUtils.getHttpServletRequest(context);
tgtId =
this.ticketGrantingTicketCookieGenerator.retrieveCookieValue(request);
}
if (tgtId != null) {
TicketGrantingTicketImpl ticket =(TicketGrantingTicketImpl)
ticketRegistry.getTicket(tgtId);
if(ticket!=null)
userSer.removeOcTmpUserStatus(ticket.getAuthentication().getPrincipal().getId());
WebUtils.putLogoutRequests(context,
this.centralAuthenticationService.destroyTicketGrantingTicket(tgtId));
}
final HttpServletResponse response =
WebUtils.getHttpServletResponse(context);
this.ticketGrantingTicketCookieGenerator.removeCookie(response);
this.warnCookieGenerator.removeCookie(response);
return this.eventFactorySupport.success(this);
}
i can get the username if client proper logout.
However, when i do cas logout like that
http://localhost:8080/cas/logout
the tgtid is null, so i cant get username....
so , my question is how to get username in Event terminate if i
do http://localhost:8080/cas/logout.
Or actually my flow is incorrect? should do it in other way?
--
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