From 1b660d4d5b925c44fcb920c3a90adb88fb37713c Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Fri, 3 Dec 2004 06:41:02 +0000 Subject: [PATCH] Handle usernames that are empty Strings. --- .../providers/dao/DaoAuthenticationProvider.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java b/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java index cd2c0b85b5..7702220078 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java @@ -226,8 +226,9 @@ public class DaoAuthenticationProvider implements AuthenticationProvider, if (this.context != null) { context.publishEvent(new AuthenticationFailureUsernameNotFoundEvent( authentication, - new User(username, "*****", false, - new GrantedAuthority[0]))); + new User("".equals(username) + ? "EMPTY_STRING_PROVIDED" : username, "*****", + false, new GrantedAuthority[0]))); } throw ex;