@Override public DirContextOperations authenticate(Authentication authentication) { if (userFilter == null || userFilter.equals("")) { // authenticate using dn return super.authenticate(authentication); } else { return authenticateUsingFilter(authentication); } }