From 14d630b8682c425880511a2c5ddf520198f55205 Mon Sep 17 00:00:00 2001 From: Fabrice Bacchella Date: Sat, 23 May 2015 14:16:03 +0200 Subject: [PATCH] Create web.rewriteSession key for use with tomcat and CAS --- src/main/java/com/gitblit/wicket/pages/SessionPage.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gitblit/wicket/pages/SessionPage.java b/src/main/java/com/gitblit/wicket/pages/SessionPage.java index 0dda9495..af7f2115 100644 --- a/src/main/java/com/gitblit/wicket/pages/SessionPage.java +++ b/src/main/java/com/gitblit/wicket/pages/SessionPage.java @@ -96,7 +96,12 @@ public abstract class SessionPage extends WebPage { .getAttribute(Constants.AUTHENTICATION_TYPE); // issue 62: fix session fixation vulnerability - session.replaceSession(); + // but only if authentication was done in the container. + // It avoid double change of session, that some authentication method + // don't like + if (AuthenticationType.CONTAINER != authenticationType) { + session.replaceSession(); + } session.setUser(user); request.getSession().setAttribute(Constants.AUTHENTICATION_TYPE, authenticationType); -- 2.39.5