diff --git a/forms-flow-bpm/forms-flow-bpm-camunda/src/main/java/org/camunda/bpm/extension/keycloak/sso/KeycloakLogoutHandler.java b/forms-flow-bpm/forms-flow-bpm-camunda/src/main/java/org/camunda/bpm/extension/keycloak/sso/KeycloakLogoutHandler.java index a0e1df29e5..5118ae35d1 100644 --- a/forms-flow-bpm/forms-flow-bpm-camunda/src/main/java/org/camunda/bpm/extension/keycloak/sso/KeycloakLogoutHandler.java +++ b/forms-flow-bpm/forms-flow-bpm-camunda/src/main/java/org/camunda/bpm/extension/keycloak/sso/KeycloakLogoutHandler.java @@ -33,6 +33,10 @@ public class KeycloakLogoutHandler implements LogoutSuccessHandler { /** Keycloak's logout URI. */ private String oauth2UserLogoutUri; + /** Keycloak's Client ID. */ + @Value("${keycloak.clientId}") + private String clientId; + /** * Default constructor. * @param oauth2UserAuthorizationUri configured keycloak authorization URI @@ -53,10 +57,10 @@ public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse resp if (!ObjectUtils.isEmpty(oauth2UserLogoutUri)) { // Calculate redirect URI for Keycloak, something like http:///camunda/login - String requestUrl = request.getRequestURL().toString(); - String redirectUri = requestUrl.substring(0, requestUrl.indexOf("/app")); + var requestUrl = request.getRequestURL().toString(); + var redirectUri = requestUrl.substring(0, requestUrl.indexOf("/app")); // Complete logout URL - String logoutUrl = oauth2UserLogoutUri + "?redirect_uri=" + redirectUri; + var logoutUrl = oauth2UserLogoutUri + "?post_logout_redirect_uri=" + redirectUri + "&client_id=" + clientId; Cookie[] cookies = request.getCookies(); for (Cookie cookie : cookies) { LOG.debug("-------cookie---------->"+cookie.getName());