mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-07 19:22:14 +00:00
SEC-1833: Remove unused securityContextClass from HttpSessionSecurityContextRepository.
This commit is contained in:
parent
fc399af136
commit
09ac4bd8f9
@ -58,7 +58,6 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
|
|||||||
|
|
||||||
protected final Log logger = LogFactory.getLog(this.getClass());
|
protected final Log logger = LogFactory.getLog(this.getClass());
|
||||||
|
|
||||||
private final Class<? extends SecurityContext> securityContextClass = null;
|
|
||||||
/** SecurityContext instance used to check for equality with default (unauthenticated) content */
|
/** SecurityContext instance used to check for equality with default (unauthenticated) content */
|
||||||
private final Object contextObject = SecurityContextHolder.createEmptyContext();
|
private final Object contextObject = SecurityContextHolder.createEmptyContext();
|
||||||
private boolean allowSessionCreation = true;
|
private boolean allowSessionCreation = true;
|
||||||
@ -169,28 +168,11 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
|
|||||||
* no context present in the holder when this method is called). Using this approach the context creation
|
* no context present in the holder when this method is called). Using this approach the context creation
|
||||||
* strategy is decided by the {@link SecurityContextHolderStrategy} in use. The default implementations
|
* strategy is decided by the {@link SecurityContextHolderStrategy} in use. The default implementations
|
||||||
* will return a new <tt>SecurityContextImpl</tt>.
|
* will return a new <tt>SecurityContextImpl</tt>.
|
||||||
* <p>
|
|
||||||
* An alternative way of customizing the <tt>SecurityContext</tt> implementation is by setting the
|
|
||||||
* <tt>securityContextClass</tt> property. In this case, the method will attempt to invoke the no-args
|
|
||||||
* constructor on the supplied class instead and return the created instance.
|
|
||||||
*
|
*
|
||||||
* @return a new SecurityContext instance. Never null.
|
* @return a new SecurityContext instance. Never null.
|
||||||
*/
|
*/
|
||||||
SecurityContext generateNewContext() {
|
protected SecurityContext generateNewContext() {
|
||||||
SecurityContext context = null;
|
return SecurityContextHolder.createEmptyContext();
|
||||||
|
|
||||||
if (securityContextClass == null) {
|
|
||||||
context = SecurityContextHolder.createEmptyContext();
|
|
||||||
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
context = securityContextClass.newInstance();
|
|
||||||
} catch (Exception e) {
|
|
||||||
ReflectionUtils.handleReflectionException(e);
|
|
||||||
}
|
|
||||||
return context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user