Skip to content
Snippets Groups Projects
Commit 336c9dfb authored by Brian Major's avatar Brian Major
Browse files

s1736 - Order DN in 'java' format on user search

parent 2765e19c
No related branches found
No related tags found
No related merge requests found
...@@ -406,9 +406,21 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO ...@@ -406,9 +406,21 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO
"Unsupported principal type " + user.getUserID() "Unsupported principal type " + user.getUserID()
.getClass()); .getClass());
} }
searchField = "(" + searchField + "=" + user.getUserID().getName() // change the DN to be in the 'java' format
+ ")"; if (user.getUserID() instanceof X500Principal)
{
X500Principal orderedPrincipal = AuthenticationUtil.getOrderedForm(
(X500Principal) user.getUserID());
searchField = "(" + searchField + "=" + orderedPrincipal.toString() + ")";
}
else
{
searchField = "(" + searchField + "=" + user.getUserID().getName()
+ ")";
}
logger.debug("Search field is: " + searchField);
SearchResultEntry searchResult = null; SearchResultEntry searchResult = null;
try try
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment