|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
- * Copyright 2002-2013 the original author or authors.
|
|
|
|
|
|
+ * Copyright 2002-2016 the original author or authors.
|
|
*
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -47,8 +47,10 @@ import org.springframework.security.web.context.SecurityContextRepository;
|
|
import org.springframework.security.web.savedrequest.NullRequestCache;
|
|
import org.springframework.security.web.savedrequest.NullRequestCache;
|
|
import org.springframework.security.web.savedrequest.RequestCache;
|
|
import org.springframework.security.web.savedrequest.RequestCache;
|
|
import org.springframework.security.web.session.ConcurrentSessionFilter;
|
|
import org.springframework.security.web.session.ConcurrentSessionFilter;
|
|
|
|
+import org.springframework.security.web.session.ExpiredSessionStrategy;
|
|
import org.springframework.security.web.session.InvalidSessionStrategy;
|
|
import org.springframework.security.web.session.InvalidSessionStrategy;
|
|
import org.springframework.security.web.session.SessionManagementFilter;
|
|
import org.springframework.security.web.session.SessionManagementFilter;
|
|
|
|
+import org.springframework.security.web.session.SimpleRedirectExpiredSessionStrategy;
|
|
import org.springframework.security.web.session.SimpleRedirectInvalidSessionStrategy;
|
|
import org.springframework.security.web.session.SimpleRedirectInvalidSessionStrategy;
|
|
import org.springframework.util.Assert;
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
@@ -89,13 +91,14 @@ import org.springframework.util.Assert;
|
|
* @see SessionManagementFilter
|
|
* @see SessionManagementFilter
|
|
* @see ConcurrentSessionFilter
|
|
* @see ConcurrentSessionFilter
|
|
*/
|
|
*/
|
|
-public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>> extends
|
|
|
|
- AbstractHttpConfigurer<SessionManagementConfigurer<H>, H> {
|
|
|
|
|
|
+public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
|
|
+ extends AbstractHttpConfigurer<SessionManagementConfigurer<H>, H> {
|
|
private final SessionAuthenticationStrategy DEFAULT_SESSION_FIXATION_STRATEGY = createDefaultSessionFixationProtectionStrategy();
|
|
private final SessionAuthenticationStrategy DEFAULT_SESSION_FIXATION_STRATEGY = createDefaultSessionFixationProtectionStrategy();
|
|
- private SessionAuthenticationStrategy sessionFixationAuthenticationStrategy = DEFAULT_SESSION_FIXATION_STRATEGY;
|
|
|
|
|
|
+ private SessionAuthenticationStrategy sessionFixationAuthenticationStrategy = this.DEFAULT_SESSION_FIXATION_STRATEGY;
|
|
private SessionAuthenticationStrategy sessionAuthenticationStrategy;
|
|
private SessionAuthenticationStrategy sessionAuthenticationStrategy;
|
|
private SessionAuthenticationStrategy providedSessionAuthenticationStrategy;
|
|
private SessionAuthenticationStrategy providedSessionAuthenticationStrategy;
|
|
private InvalidSessionStrategy invalidSessionStrategy;
|
|
private InvalidSessionStrategy invalidSessionStrategy;
|
|
|
|
+ private ExpiredSessionStrategy expiredSessionStrategy;
|
|
private List<SessionAuthenticationStrategy> sessionAuthenticationStrategies = new ArrayList<SessionAuthenticationStrategy>();
|
|
private List<SessionAuthenticationStrategy> sessionAuthenticationStrategies = new ArrayList<SessionAuthenticationStrategy>();
|
|
private SessionRegistry sessionRegistry;
|
|
private SessionRegistry sessionRegistry;
|
|
private Integer maximumSessions;
|
|
private Integer maximumSessions;
|
|
@@ -131,10 +134,12 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* Setting this attribute will inject the provided invalidSessionStrategy into the
|
|
* Setting this attribute will inject the provided invalidSessionStrategy into the
|
|
* {@link SessionManagementFilter}. When an invalid session ID is submitted, the
|
|
* {@link SessionManagementFilter}. When an invalid session ID is submitted, the
|
|
* strategy will be invoked, redirecting to the configured URL.
|
|
* strategy will be invoked, redirecting to the configured URL.
|
|
- * @param invalidSessionStrategy the strategy to use when an invalid session ID is submitted.
|
|
|
|
|
|
+ * @param invalidSessionStrategy the strategy to use when an invalid session ID is
|
|
|
|
+ * submitted.
|
|
* @return the {@link SessionManagementConfigurer} for further customization
|
|
* @return the {@link SessionManagementConfigurer} for further customization
|
|
*/
|
|
*/
|
|
- public SessionManagementConfigurer<H> invalidSessionStrategy(InvalidSessionStrategy invalidSessionStrategy) {
|
|
|
|
|
|
+ public SessionManagementConfigurer<H> invalidSessionStrategy(
|
|
|
|
+ InvalidSessionStrategy invalidSessionStrategy) {
|
|
Assert.notNull(invalidSessionStrategy, "invalidSessionStrategy");
|
|
Assert.notNull(invalidSessionStrategy, "invalidSessionStrategy");
|
|
this.invalidSessionStrategy = invalidSessionStrategy;
|
|
this.invalidSessionStrategy = invalidSessionStrategy;
|
|
return this;
|
|
return this;
|
|
@@ -198,7 +203,8 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* {@link SessionAuthenticationStrategy} the supplied sessionAuthenticationStrategy,
|
|
* {@link SessionAuthenticationStrategy} the supplied sessionAuthenticationStrategy,
|
|
* {@link RegisterSessionAuthenticationStrategy}.
|
|
* {@link RegisterSessionAuthenticationStrategy}.
|
|
*
|
|
*
|
|
- * NOTE: Supplying a custom {@link SessionAuthenticationStrategy} will override the default provided {@link SessionFixationProtectionStrategy}.
|
|
|
|
|
|
+ * NOTE: Supplying a custom {@link SessionAuthenticationStrategy} will override the
|
|
|
|
+ * default provided {@link SessionFixationProtectionStrategy}.
|
|
*
|
|
*
|
|
* @param sessionAuthenticationStrategy
|
|
* @param sessionAuthenticationStrategy
|
|
* @return the {@link SessionManagementConfigurer} for further customizations
|
|
* @return the {@link SessionManagementConfigurer} for further customizations
|
|
@@ -244,7 +250,8 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
*/
|
|
*/
|
|
private void setSessionFixationAuthenticationStrategy(
|
|
private void setSessionFixationAuthenticationStrategy(
|
|
SessionAuthenticationStrategy sessionFixationAuthenticationStrategy) {
|
|
SessionAuthenticationStrategy sessionFixationAuthenticationStrategy) {
|
|
- this.sessionFixationAuthenticationStrategy = postProcess(sessionFixationAuthenticationStrategy);
|
|
|
|
|
|
+ this.sessionFixationAuthenticationStrategy = postProcess(
|
|
|
|
+ sessionFixationAuthenticationStrategy);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -273,7 +280,8 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* @return the {@link SessionManagementConfigurer} for further customizations
|
|
* @return the {@link SessionManagementConfigurer} for further customizations
|
|
*/
|
|
*/
|
|
public SessionManagementConfigurer<H> migrateSession() {
|
|
public SessionManagementConfigurer<H> migrateSession() {
|
|
- setSessionFixationAuthenticationStrategy(new SessionFixationProtectionStrategy());
|
|
|
|
|
|
+ setSessionFixationAuthenticationStrategy(
|
|
|
|
+ new SessionFixationProtectionStrategy());
|
|
return SessionManagementConfigurer.this;
|
|
return SessionManagementConfigurer.this;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -288,7 +296,8 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* @throws IllegalStateException if the container is not Servlet 3.1 or newer.
|
|
* @throws IllegalStateException if the container is not Servlet 3.1 or newer.
|
|
*/
|
|
*/
|
|
public SessionManagementConfigurer<H> changeSessionId() {
|
|
public SessionManagementConfigurer<H> changeSessionId() {
|
|
- setSessionFixationAuthenticationStrategy(new ChangeSessionIdAuthenticationStrategy());
|
|
|
|
|
|
+ setSessionFixationAuthenticationStrategy(
|
|
|
|
+ new ChangeSessionIdAuthenticationStrategy());
|
|
return SessionManagementConfigurer.this;
|
|
return SessionManagementConfigurer.this;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -301,7 +310,8 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* @return the {@link SessionManagementConfigurer} for further customizations
|
|
* @return the {@link SessionManagementConfigurer} for further customizations
|
|
*/
|
|
*/
|
|
public SessionManagementConfigurer<H> none() {
|
|
public SessionManagementConfigurer<H> none() {
|
|
- setSessionFixationAuthenticationStrategy(new NullAuthenticatedSessionStrategy());
|
|
|
|
|
|
+ setSessionFixationAuthenticationStrategy(
|
|
|
|
+ new NullAuthenticatedSessionStrategy());
|
|
return SessionManagementConfigurer.this;
|
|
return SessionManagementConfigurer.this;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -326,6 +336,12 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public ConcurrencyControlConfigurer expiredSessionStrategy(
|
|
|
|
+ ExpiredSessionStrategy expiredSessionStrategy) {
|
|
|
|
+ SessionManagementConfigurer.this.expiredSessionStrategy = expiredSessionStrategy;
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* If true, prevents a user from authenticating when the
|
|
* If true, prevents a user from authenticating when the
|
|
* {@link #maximumSessions(int)} has been reached. Otherwise (default), the user
|
|
* {@link #maximumSessions(int)} has been reached. Otherwise (default), the user
|
|
@@ -384,7 +400,8 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
HttpSessionSecurityContextRepository httpSecurityRepository = new HttpSessionSecurityContextRepository();
|
|
HttpSessionSecurityContextRepository httpSecurityRepository = new HttpSessionSecurityContextRepository();
|
|
- httpSecurityRepository.setDisableUrlRewriting(!enableSessionUrlRewriting);
|
|
|
|
|
|
+ httpSecurityRepository
|
|
|
|
+ .setDisableUrlRewriting(!this.enableSessionUrlRewriting);
|
|
httpSecurityRepository.setAllowSessionCreation(isAllowSessionCreation());
|
|
httpSecurityRepository.setAllowSessionCreation(isAllowSessionCreation());
|
|
AuthenticationTrustResolver trustResolver = http
|
|
AuthenticationTrustResolver trustResolver = http
|
|
.getSharedObject(AuthenticationTrustResolver.class);
|
|
.getSharedObject(AuthenticationTrustResolver.class);
|
|
@@ -413,15 +430,14 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
.getSharedObject(SecurityContextRepository.class);
|
|
.getSharedObject(SecurityContextRepository.class);
|
|
SessionManagementFilter sessionManagementFilter = new SessionManagementFilter(
|
|
SessionManagementFilter sessionManagementFilter = new SessionManagementFilter(
|
|
securityContextRepository, getSessionAuthenticationStrategy(http));
|
|
securityContextRepository, getSessionAuthenticationStrategy(http));
|
|
- if (sessionAuthenticationErrorUrl != null) {
|
|
|
|
- sessionManagementFilter
|
|
|
|
- .setAuthenticationFailureHandler(new SimpleUrlAuthenticationFailureHandler(
|
|
|
|
- sessionAuthenticationErrorUrl));
|
|
|
|
|
|
+ if (this.sessionAuthenticationErrorUrl != null) {
|
|
|
|
+ sessionManagementFilter.setAuthenticationFailureHandler(
|
|
|
|
+ new SimpleUrlAuthenticationFailureHandler(
|
|
|
|
+ this.sessionAuthenticationErrorUrl));
|
|
}
|
|
}
|
|
InvalidSessionStrategy strategy = getInvalidSessionStrategy();
|
|
InvalidSessionStrategy strategy = getInvalidSessionStrategy();
|
|
if (strategy != null) {
|
|
if (strategy != null) {
|
|
- sessionManagementFilter
|
|
|
|
- .setInvalidSessionStrategy(strategy);
|
|
|
|
|
|
+ sessionManagementFilter.setInvalidSessionStrategy(strategy);
|
|
}
|
|
}
|
|
AuthenticationTrustResolver trustResolver = http
|
|
AuthenticationTrustResolver trustResolver = http
|
|
.getSharedObject(AuthenticationTrustResolver.class);
|
|
.getSharedObject(AuthenticationTrustResolver.class);
|
|
@@ -433,7 +449,10 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
http.addFilter(sessionManagementFilter);
|
|
http.addFilter(sessionManagementFilter);
|
|
if (isConcurrentSessionControlEnabled()) {
|
|
if (isConcurrentSessionControlEnabled()) {
|
|
ConcurrentSessionFilter concurrentSessionFilter = new ConcurrentSessionFilter(
|
|
ConcurrentSessionFilter concurrentSessionFilter = new ConcurrentSessionFilter(
|
|
- getSessionRegistry(http), expiredUrl);
|
|
|
|
|
|
+ getSessionRegistry(http));
|
|
|
|
+ concurrentSessionFilter
|
|
|
|
+ .setExpiredSessionStrategy(getExpiredSessionStrategy());
|
|
|
|
+
|
|
concurrentSessionFilter = postProcess(concurrentSessionFilter);
|
|
concurrentSessionFilter = postProcess(concurrentSessionFilter);
|
|
http.addFilter(concurrentSessionFilter);
|
|
http.addFilter(concurrentSessionFilter);
|
|
}
|
|
}
|
|
@@ -447,14 +466,30 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* @return the {@link InvalidSessionStrategy} to use
|
|
* @return the {@link InvalidSessionStrategy} to use
|
|
*/
|
|
*/
|
|
InvalidSessionStrategy getInvalidSessionStrategy() {
|
|
InvalidSessionStrategy getInvalidSessionStrategy() {
|
|
- if(invalidSessionStrategy != null) {
|
|
|
|
- return invalidSessionStrategy;
|
|
|
|
|
|
+ if (this.invalidSessionStrategy != null) {
|
|
|
|
+ return this.invalidSessionStrategy;
|
|
}
|
|
}
|
|
- if (invalidSessionUrl != null) {
|
|
|
|
- invalidSessionStrategy = new SimpleRedirectInvalidSessionStrategy(
|
|
|
|
- invalidSessionUrl);
|
|
|
|
|
|
+ if (this.invalidSessionUrl != null) {
|
|
|
|
+ this.invalidSessionStrategy = new SimpleRedirectInvalidSessionStrategy(
|
|
|
|
+ this.invalidSessionUrl);
|
|
}
|
|
}
|
|
- return invalidSessionStrategy;
|
|
|
|
|
|
+ return this.invalidSessionStrategy;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ExpiredSessionStrategy getExpiredSessionStrategy() {
|
|
|
|
+ if (this.expiredSessionStrategy != null) {
|
|
|
|
+ return this.expiredSessionStrategy;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.expiredUrl == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.expiredSessionStrategy == null) {
|
|
|
|
+ this.expiredSessionStrategy = new SimpleRedirectExpiredSessionStrategy(
|
|
|
|
+ this.expiredUrl);
|
|
|
|
+ }
|
|
|
|
+ return this.expiredSessionStrategy;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -462,7 +497,7 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* @return the {@link SessionCreationPolicy}
|
|
* @return the {@link SessionCreationPolicy}
|
|
*/
|
|
*/
|
|
SessionCreationPolicy getSessionCreationPolicy() {
|
|
SessionCreationPolicy getSessionCreationPolicy() {
|
|
- return sessionPolicy;
|
|
|
|
|
|
+ return this.sessionPolicy;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -471,8 +506,8 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* @return true if the {@link SessionCreationPolicy} allows session creation
|
|
* @return true if the {@link SessionCreationPolicy} allows session creation
|
|
*/
|
|
*/
|
|
private boolean isAllowSessionCreation() {
|
|
private boolean isAllowSessionCreation() {
|
|
- return SessionCreationPolicy.ALWAYS == sessionPolicy
|
|
|
|
- || SessionCreationPolicy.IF_REQUIRED == sessionPolicy;
|
|
|
|
|
|
+ return SessionCreationPolicy.ALWAYS == this.sessionPolicy
|
|
|
|
+ || SessionCreationPolicy.IF_REQUIRED == this.sessionPolicy;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -480,7 +515,7 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
private boolean isStateless() {
|
|
private boolean isStateless() {
|
|
- return SessionCreationPolicy.STATELESS == sessionPolicy;
|
|
|
|
|
|
+ return SessionCreationPolicy.STATELESS == this.sessionPolicy;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -491,50 +526,52 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* @return the {@link SessionAuthenticationStrategy} to use
|
|
* @return the {@link SessionAuthenticationStrategy} to use
|
|
*/
|
|
*/
|
|
private SessionAuthenticationStrategy getSessionAuthenticationStrategy(H http) {
|
|
private SessionAuthenticationStrategy getSessionAuthenticationStrategy(H http) {
|
|
- if (sessionAuthenticationStrategy != null) {
|
|
|
|
- return sessionAuthenticationStrategy;
|
|
|
|
|
|
+ if (this.sessionAuthenticationStrategy != null) {
|
|
|
|
+ return this.sessionAuthenticationStrategy;
|
|
}
|
|
}
|
|
- List<SessionAuthenticationStrategy> delegateStrategies = sessionAuthenticationStrategies;
|
|
|
|
|
|
+ List<SessionAuthenticationStrategy> delegateStrategies = this.sessionAuthenticationStrategies;
|
|
SessionAuthenticationStrategy defaultSessionAuthenticationStrategy;
|
|
SessionAuthenticationStrategy defaultSessionAuthenticationStrategy;
|
|
- if (providedSessionAuthenticationStrategy == null) {
|
|
|
|
|
|
+ if (this.providedSessionAuthenticationStrategy == null) {
|
|
// If a user provided SessionAuthenticationStrategy is not supplied
|
|
// If a user provided SessionAuthenticationStrategy is not supplied
|
|
// then default to SessionFixationProtectionStrategy
|
|
// then default to SessionFixationProtectionStrategy
|
|
- defaultSessionAuthenticationStrategy = postProcess(sessionFixationAuthenticationStrategy);
|
|
|
|
- } else {
|
|
|
|
- defaultSessionAuthenticationStrategy = providedSessionAuthenticationStrategy;
|
|
|
|
|
|
+ defaultSessionAuthenticationStrategy = postProcess(
|
|
|
|
+ this.sessionFixationAuthenticationStrategy);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ defaultSessionAuthenticationStrategy = this.providedSessionAuthenticationStrategy;
|
|
}
|
|
}
|
|
if (isConcurrentSessionControlEnabled()) {
|
|
if (isConcurrentSessionControlEnabled()) {
|
|
SessionRegistry sessionRegistry = getSessionRegistry(http);
|
|
SessionRegistry sessionRegistry = getSessionRegistry(http);
|
|
ConcurrentSessionControlAuthenticationStrategy concurrentSessionControlStrategy = new ConcurrentSessionControlAuthenticationStrategy(
|
|
ConcurrentSessionControlAuthenticationStrategy concurrentSessionControlStrategy = new ConcurrentSessionControlAuthenticationStrategy(
|
|
sessionRegistry);
|
|
sessionRegistry);
|
|
- concurrentSessionControlStrategy.setMaximumSessions(maximumSessions);
|
|
|
|
|
|
+ concurrentSessionControlStrategy.setMaximumSessions(this.maximumSessions);
|
|
concurrentSessionControlStrategy
|
|
concurrentSessionControlStrategy
|
|
- .setExceptionIfMaximumExceeded(maxSessionsPreventsLogin);
|
|
|
|
- concurrentSessionControlStrategy = postProcess(concurrentSessionControlStrategy);
|
|
|
|
|
|
+ .setExceptionIfMaximumExceeded(this.maxSessionsPreventsLogin);
|
|
|
|
+ concurrentSessionControlStrategy = postProcess(
|
|
|
|
+ concurrentSessionControlStrategy);
|
|
|
|
|
|
RegisterSessionAuthenticationStrategy registerSessionStrategy = new RegisterSessionAuthenticationStrategy(
|
|
RegisterSessionAuthenticationStrategy registerSessionStrategy = new RegisterSessionAuthenticationStrategy(
|
|
sessionRegistry);
|
|
sessionRegistry);
|
|
registerSessionStrategy = postProcess(registerSessionStrategy);
|
|
registerSessionStrategy = postProcess(registerSessionStrategy);
|
|
|
|
|
|
- delegateStrategies.addAll(Arrays.asList(
|
|
|
|
- concurrentSessionControlStrategy,
|
|
|
|
- defaultSessionAuthenticationStrategy,
|
|
|
|
- registerSessionStrategy));
|
|
|
|
- } else {
|
|
|
|
|
|
+ delegateStrategies.addAll(Arrays.asList(concurrentSessionControlStrategy,
|
|
|
|
+ defaultSessionAuthenticationStrategy, registerSessionStrategy));
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
delegateStrategies.add(defaultSessionAuthenticationStrategy);
|
|
delegateStrategies.add(defaultSessionAuthenticationStrategy);
|
|
}
|
|
}
|
|
- sessionAuthenticationStrategy = postProcess(new CompositeSessionAuthenticationStrategy(
|
|
|
|
- delegateStrategies));
|
|
|
|
- return sessionAuthenticationStrategy;
|
|
|
|
|
|
+ this.sessionAuthenticationStrategy = postProcess(
|
|
|
|
+ new CompositeSessionAuthenticationStrategy(delegateStrategies));
|
|
|
|
+ return this.sessionAuthenticationStrategy;
|
|
}
|
|
}
|
|
|
|
|
|
private SessionRegistry getSessionRegistry(H http) {
|
|
private SessionRegistry getSessionRegistry(H http) {
|
|
- if (sessionRegistry == null) {
|
|
|
|
|
|
+ if (this.sessionRegistry == null) {
|
|
SessionRegistryImpl sessionRegistry = new SessionRegistryImpl();
|
|
SessionRegistryImpl sessionRegistry = new SessionRegistryImpl();
|
|
registerDelegateApplicationListener(http, sessionRegistry);
|
|
registerDelegateApplicationListener(http, sessionRegistry);
|
|
this.sessionRegistry = sessionRegistry;
|
|
this.sessionRegistry = sessionRegistry;
|
|
}
|
|
}
|
|
- return sessionRegistry;
|
|
|
|
|
|
+ return this.sessionRegistry;
|
|
}
|
|
}
|
|
|
|
|
|
private void registerDelegateApplicationListener(H http,
|
|
private void registerDelegateApplicationListener(H http,
|
|
@@ -558,7 +595,7 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
private boolean isConcurrentSessionControlEnabled() {
|
|
private boolean isConcurrentSessionControlEnabled() {
|
|
- return maximumSessions != null;
|
|
|
|
|
|
+ return this.maximumSessions != null;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|