martedì 11 gennaio 2011

Return Userdn form a LDAP search

<code type="java">
SearchResult searchResult = null;
if (namEnum.hasMore()) {
searchResult = (SearchResult) namEnum.next();

// Build the User DN
userDN = searchResult.getName() + "," + sAPPEND_BASE_DN;
} else {
// User not found
throw new NamingException(" Invalid Username ");
}
System.out.println("User DN="+userDN);
</code>

Nessun commento:

Posta un commento