Index: ActiveDirectoryAuthenticationProvider.java =================================================================== --- ActiveDirectoryAuthenticationProvider.java (revision 16504) +++ ActiveDirectoryAuthenticationProvider.java (working copy) @@ -95,7 +95,10 @@ } catch (ComException e) { throw new BadCredentialsException("Incorrect password for "+username); } - + // If username is in fact a group + if (usr == null) { + throw new UsernameNotFoundException("User not found: "+username); + } List groups = new ArrayList(); for( Com4jObject g : usr.groups() ) { IADsGroup grp = g.queryInterface(IADsGroup.class);