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