DistinguishedNameCredential dnCredential;
dnCredential = (DistinguishedNameCredential)credentials;
sAuthenticatedDN = dnCredential.getDistinguishedName();
} else if (credentials instanceof UsernameCredential) {
UsernameCredential unCredential = (UsernameCredential)credentials;
String sBaseDN = userProps.getUserSearchDIT();
String sFilter = userProps.returnUserLoginSearchFilter(unCredential.getUsername());
StringSet ssDNs = getQueryFunctions().searchDNs(
getConnectedContext(),sBaseDN,sFilter);
if (ssDNs.size() > 1) {
throw new IdentityException("Multiple LDAP usernames matched for:"+ unCredential.getUsername());
} else if (ssDNs.size() == 1) {
sAuthenticatedDN = ssDNs.iterator().next();
}
}
}