From ea64d6161cf72ca3705690d5984d7dc8f9928f58 Mon Sep 17 00:00:00 2001 From: Doccrazy <Doccrazy@users.noreply.github.com> Date: Wed, 26 Jul 2017 17:35:01 +0000 Subject: [PATCH] Update README.md --- src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java index 8198a35..7d82a9a 100644 --- a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java +++ b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java @@ -5,6 +5,7 @@ import org.keycloak.common.util.KeycloakUriBuilder; import org.keycloak.events.EventBuilder; import org.keycloak.events.EventType; +import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.models.*; import org.keycloak.protocol.LoginProtocol; import org.keycloak.protocol.cas.utils.LogoutHelper; @@ -32,6 +33,8 @@ public static final String SERVICE_TICKET_PREFIX = "ST-"; public static final String SESSION_SERVICE_TICKET = "service_ticket"; + + public static final String LOGOUT_REDIRECT_URI = "CAS_LOGOUT_REDIRECT_URI"; protected KeycloakSession session; protected RealmModel realm; @@ -131,9 +134,17 @@ @Override public Response finishLogout(UserSessionModel userSession) { + String redirectUri = userSession.getNote(CASLoginProtocol.LOGOUT_REDIRECT_URI); + event.event(EventType.LOGOUT); event.user(userSession.getUser()).session(userSession).success(); - return Response.ok().build(); + LoginFormsProvider infoPage = session.getProvider(LoginFormsProvider.class).setSuccess("Logout successful"); + if (redirectUri != null) { + infoPage.setAttribute("pageRedirectUri", redirectUri); + } else { + infoPage.setAttribute("skipLink", true); + } + return infoPage.createInfoPage(); } @Override -- Gitblit v1.9.1