Server-side communication and logout using proxy tickets

10 views
Skip to first unread message

Alexandre Arcanjo de Queiroz

unread,
Oct 20, 2016, 8:52:47 AM10/20/16
to CAS Community
Hi.

I have this code for invoke a REST webservice from webapp1 in webapp2:

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 
final String targetUrl = "https://localhost:8443/webapp2/protected";
final CasAuthenticationToken casAuthenticationToken = (CasAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();
final String proxyTicket = casAuthenticationToken.getAssertion().getPrincipal().getProxyTicketFor(targetUrl);

final String response = Http.get(targetUrl + "?ticket=" + URLEncoder.encode(proxyTicket, "UTF-8"));

// Logout Webapp2? I don't know

// Do something with response
}

How can I logout for remote application after invoking server-side communication using proxy ticket?

A session is created every time that I invoke this code in webapp2. How can I logged out/destroy session created in webapp2?
Reply all
Reply to author
Forward
0 new messages