@@ -144,23 +144,26 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
144
144
try {
145
145
UsernamePasswordAuthenticationToken authRequest = this .authenticationConverter .convert (request );
146
146
if (authRequest == null ) {
147
+ this .logger .trace ("Did not process authentication request since failed to find "
148
+ + "username and password in Basic Authorization header" );
147
149
chain .doFilter (request , response );
148
150
return ;
149
151
}
150
152
String username = authRequest .getName ();
151
- this .logger .debug (
152
- LogMessage .format ("Basic Authentication Authorization header found for user '%s'" , username ));
153
+ this .logger .trace (LogMessage .format ("Found username '%s' in Basic Authorization header" , username ));
153
154
if (authenticationIsRequired (username )) {
154
155
Authentication authResult = this .authenticationManager .authenticate (authRequest );
155
- this .logger .debug (LogMessage .format ("Authentication success: %s" , authResult ));
156
156
SecurityContextHolder .getContext ().setAuthentication (authResult );
157
+ if (this .logger .isDebugEnabled ()) {
158
+ this .logger .debug (LogMessage .format ("Set SecurityContextHolder to %s" , authResult ));
159
+ }
157
160
this .rememberMeServices .loginSuccess (request , response , authResult );
158
161
onSuccessfulAuthentication (request , response , authResult );
159
162
}
160
163
}
161
164
catch (AuthenticationException ex ) {
162
165
SecurityContextHolder .clearContext ();
163
- this .logger .debug ("Authentication request for failed! " , ex );
166
+ this .logger .debug ("Failed to process authentication request " , ex );
164
167
this .rememberMeServices .loginFail (request , response );
165
168
onUnsuccessfulAuthentication (request , response , ex );
166
169
if (this .ignoreFailure ) {
0 commit comments