File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
web/src/main/java/org/springframework/security/web/authentication/www Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,8 @@ protected boolean authenticationIsRequired(String username) {
217
217
// Only reauthenticate if username doesn't match SecurityContextHolder and user
218
218
// isn't authenticated (see SEC-53)
219
219
Authentication existingAuth = this .securityContextHolderStrategy .getContext ().getAuthentication ();
220
- if (existingAuth == null || !existingAuth .getName ().equals (username ) || !existingAuth .isAuthenticated ()) {
220
+ if (existingAuth == null || existingAuth .getName () == null || !existingAuth .getName ().equals (username )
221
+ || !existingAuth .isAuthenticated ()) {
221
222
return true ;
222
223
}
223
224
// Handle unusual condition where an AnonymousAuthenticationToken is already
You can’t perform that action at this time.
0 commit comments