Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2012-08-19 20:21:07 -0400
committerGreg Wilkins2012-08-19 20:21:07 -0400
commit1d89bef7a25626f97b306c1a1b61297dd20e5be8 (patch)
tree22fee3f6455e949cfcc5be4ccd4ea4415eb7f1c1 /jetty-security/src/main/java/org/eclipse/jetty/security
parent4f30fb17a61b223e90d02efe2bfa03cc9e37efac (diff)
downloadorg.eclipse.jetty.project-1d89bef7a25626f97b306c1a1b61297dd20e5be8.tar.gz
org.eclipse.jetty.project-1d89bef7a25626f97b306c1a1b61297dd20e5be8.tar.xz
org.eclipse.jetty.project-1d89bef7a25626f97b306c1a1b61297dd20e5be8.zip
jetty-9 fixed context restart for constraint test
Diffstat (limited to 'jetty-security/src/main/java/org/eclipse/jetty/security')
-rw-r--r--jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java4
-rw-r--r--jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java19
2 files changed, 12 insertions, 11 deletions
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java
index ebd441616b..d323fce2a7 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java
@@ -236,10 +236,8 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
@Override
protected void doStop() throws Exception
{
- _constraintMap.clear();
- _constraintMappings.clear();
- _roles.clear();
super.doStop();
+ _constraintMap.clear();
}
protected void processConstraintMapping(ConstraintMapping mapping)
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java
index aefd171814..e5d033ae0f 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java
@@ -74,17 +74,20 @@ public abstract class LoginAuthenticator implements Authenticator
{
HttpSession httpSession = request.getSession(false);
- synchronized (httpSession)
+ if (_renewSession && httpSession!=null)
{
- //if we should renew sessions, and there is an existing session that may have been seen by non-authenticated users
- //(indicated by SESSION_SECURED not being set on the session) then we should change id
- if (_renewSession && httpSession!=null && httpSession.getAttribute(AbstractSessionManager.SESSION_KNOWN_ONLY_TO_AUTHENTICATED)!=Boolean.TRUE)
+ synchronized (httpSession)
{
- HttpSession newSession = AbstractSessionManager.renewSession(request, httpSession,true);
- LOG.debug("renew {}->{}",httpSession.getId(),newSession.getId());
- httpSession=newSession;
+ //if we should renew sessions, and there is an existing session that may have been seen by non-authenticated users
+ //(indicated by SESSION_SECURED not being set on the session) then we should change id
+ if (httpSession.getAttribute(AbstractSessionManager.SESSION_KNOWN_ONLY_TO_AUTHENTICATED)!=Boolean.TRUE)
+ {
+ HttpSession newSession = AbstractSessionManager.renewSession(request, httpSession,true);
+ LOG.debug("renew {}->{}",httpSession.getId(),newSession.getId());
+ httpSession=newSession;
+ }
}
- return httpSession;
}
+ return httpSession;
}
}

Back to the top