Skip to content

Commit 67830d4

Browse files
committed
Polish setSecurityContextHolderStrategy
1 parent 0d65de9 commit 67830d4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLoginPageGeneratingFilter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,14 @@ private void initAuthFilter(UsernamePasswordAuthenticationFilter authFilter) {
123123
}
124124
}
125125

126+
/**
127+
* Use this {@link SecurityContextHolderStrategy} to retrieve authenticated users.
128+
* <p>Uses {@link SecurityContextHolder#getContextHolderStrategy()} by default.
129+
* @param securityContextHolderStrategy the strategy to use
130+
* @since 7.0
131+
*/
126132
public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) {
133+
Assert.notNull(securityContextHolderStrategy, "securityContextHolderStrategy cannot be null");
127134
this.securityContextHolderStrategy = securityContextHolderStrategy;
128135
}
129136

0 commit comments

Comments
 (0)