1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.client.enduser.pages;
20
21 import java.net.URLEncoder;
22 import java.nio.charset.StandardCharsets;
23 import org.apache.syncope.client.ui.commons.SAML2SP4UIConstants;
24 import org.apache.wicket.Session;
25 import org.apache.wicket.markup.html.WebPage;
26 import org.apache.wicket.request.UrlUtils;
27 import org.apache.wicket.request.cycle.RequestCycle;
28 import org.apache.wicket.request.http.handler.RedirectRequestHandler;
29 import org.apache.wicket.request.mapper.parameter.PageParameters;
30
31 public class SAML2SPBeforeLogout extends WebPage {
32
33 private static final long serialVersionUID = 3727183730959367707L;
34
35 public SAML2SPBeforeLogout(final PageParameters parameters) {
36 super(parameters);
37
38 String idpEntityId = URLEncoder.encode(
39 Session.get().getAttribute(SAML2SP4UIConstants.SAML2SP4UI_IDP_ENTITY_ID).toString(),
40 StandardCharsets.UTF_8);
41 RequestCycle.get().scheduleRequestHandlerAfterCurrent(new RedirectRequestHandler(
42 UrlUtils.rewriteToContextRelative(SAML2SP4UIConstants.URL_CONTEXT + "/logout"
43 + "?" + SAML2SP4UIConstants.SAML2SP4UI_IDP_ENTITY_ID + "=" + idpEntityId,
44 RequestCycle.get())));
45 }
46 }