We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46ee6ed commit a1bdf93Copy full SHA for a1bdf93
web/src/main/java/org/springframework/security/web/authentication/www/BasicAuthenticationFilter.java
@@ -217,7 +217,8 @@ protected boolean authenticationIsRequired(String username) {
217
// Only reauthenticate if username doesn't match SecurityContextHolder and user
218
// isn't authenticated (see SEC-53)
219
Authentication existingAuth = this.securityContextHolderStrategy.getContext().getAuthentication();
220
- if (existingAuth == null || !existingAuth.getName().equals(username) || !existingAuth.isAuthenticated()) {
+ if (existingAuth == null || existingAuth.getName() == null || !existingAuth.getName().equals(username)
221
+ || !existingAuth.isAuthenticated()) {
222
return true;
223
}
224
// Handle unusual condition where an AnonymousAuthenticationToken is already
0 commit comments