SEC-2407: Better error message for missing securityFilterChainBuilders

This commit is contained in:
Rob Winch 2013-11-26 10:12:55 -06:00
parent e97758dd3a
commit 13c5af5b91
1 changed files with 4 additions and 1 deletions

View File

@ -280,7 +280,10 @@ public final class WebSecurity extends
@Override @Override
protected Filter performBuild() throws Exception { protected Filter performBuild() throws Exception {
Assert.state(!securityFilterChainBuilders.isEmpty(), "At least one SecurityFilterBuilder needs to be specified. Invoke FilterChainProxyBuilder.securityFilterChains"); Assert.state(!securityFilterChainBuilders.isEmpty(),
"At least one SecurityBuilder<? extends SecurityFilterChain> needs to be specified. Typically this done by adding a @Configuration that extends WebSecurityConfigurerAdapter. More advanced users can invoke "
+ WebSecurity.class.getSimpleName()
+ ".addSecurityFilterChainBuilder directly");
int chainSize = ignoredRequests.size() + securityFilterChainBuilders.size(); int chainSize = ignoredRequests.size() + securityFilterChainBuilders.size();
List<SecurityFilterChain> securityFilterChains = new ArrayList<SecurityFilterChain>(chainSize); List<SecurityFilterChain> securityFilterChains = new ArrayList<SecurityFilterChain>(chainSize);
for(RequestMatcher ignoredRequest : ignoredRequests) { for(RequestMatcher ignoredRequest : ignoredRequests) {