@@ -133,11 +133,13 @@ private void checkForDuplicates(Class<? extends Filter> clazz, List<Filter> filt
133
133
* interceptor
134
134
*/
135
135
private void checkLoginPageIsntProtected (FilterChainProxy fcp , List <Filter > filterStack ) {
136
- ExceptionTranslationFilter etf = getFilter (ExceptionTranslationFilter .class , filterStack );
137
- if (etf == null || !(etf .getAuthenticationEntryPoint () instanceof LoginUrlAuthenticationEntryPoint )) {
136
+ ExceptionTranslationFilter exceptions = getFilter (ExceptionTranslationFilter .class , filterStack );
137
+ if (exceptions == null
138
+ || !(exceptions .getAuthenticationEntryPoint () instanceof LoginUrlAuthenticationEntryPoint )) {
138
139
return ;
139
140
}
140
- String loginPage = ((LoginUrlAuthenticationEntryPoint ) etf .getAuthenticationEntryPoint ()).getLoginFormUrl ();
141
+ String loginPage = ((LoginUrlAuthenticationEntryPoint ) exceptions .getAuthenticationEntryPoint ())
142
+ .getLoginFormUrl ();
141
143
this .logger .info ("Checking whether login URL '" + loginPage + "' is accessible with your configuration" );
142
144
FilterInvocation loginRequest = new FilterInvocation (loginPage , "POST" );
143
145
List <Filter > filters = null ;
@@ -158,28 +160,28 @@ private void checkLoginPageIsntProtected(FilterChainProxy fcp, List<Filter> filt
158
160
this .logger .debug ("Default generated login page is in use" );
159
161
return ;
160
162
}
161
- FilterSecurityInterceptor fsi = getFilter (FilterSecurityInterceptor .class , filters );
162
- FilterInvocationSecurityMetadataSource fids = fsi .getSecurityMetadataSource ();
163
+ FilterSecurityInterceptor authorizationInterceptor = getFilter (FilterSecurityInterceptor .class , filters );
164
+ FilterInvocationSecurityMetadataSource fids = authorizationInterceptor .getSecurityMetadataSource ();
163
165
Collection <ConfigAttribute > attributes = fids .getAttributes (loginRequest );
164
166
if (attributes == null ) {
165
167
this .logger .debug ("No access attributes defined for login page URL" );
166
- if (fsi .isRejectPublicInvocations ()) {
168
+ if (authorizationInterceptor .isRejectPublicInvocations ()) {
167
169
this .logger .warn ("FilterSecurityInterceptor is configured to reject public invocations."
168
170
+ " Your login page may not be accessible." );
169
171
}
170
172
return ;
171
173
}
172
- AnonymousAuthenticationFilter anonPF = getFilter (AnonymousAuthenticationFilter .class , filters );
173
- if (anonPF == null ) {
174
+ AnonymousAuthenticationFilter anonymous = getFilter (AnonymousAuthenticationFilter .class , filters );
175
+ if (anonymous == null ) {
174
176
this .logger .warn ("The login page is being protected by the filter chain, but you don't appear to have"
175
177
+ " anonymous authentication enabled. This is almost certainly an error." );
176
178
return ;
177
179
}
178
180
// Simulate an anonymous access with the supplied attributes.
179
- AnonymousAuthenticationToken token = new AnonymousAuthenticationToken ("key" , anonPF .getPrincipal (),
180
- anonPF .getAuthorities ());
181
+ AnonymousAuthenticationToken token = new AnonymousAuthenticationToken ("key" , anonymous .getPrincipal (),
182
+ anonymous .getAuthorities ());
181
183
try {
182
- fsi .getAccessDecisionManager ().decide (token , loginRequest , attributes );
184
+ authorizationInterceptor .getAccessDecisionManager ().decide (token , loginRequest , attributes );
183
185
}
184
186
catch (AccessDeniedException ex ) {
185
187
this .logger .warn ("Anonymous access to the login page doesn't appear to be enabled. "
0 commit comments