code: private String getUserDn(String callerName, String filter, SearchControls controls) {
          String userDn = null;
          String searchBase = idStoreDefinition.getCallerSearchBase();
          if (searchBase == null || searchBase.isEmpty()) {
              userDn = idStoreDefinition.getCallerNameAttribute() + "=" + callerName + "," + idStoreDefinition.getCallerBaseDn();
          } else {
              DirContext ctx = null;
              try {
                  ctx = bind();
              } catch (NamingException e) {
                  Tr.error(tc, "JAVAEESEC_ERROR_EXCEPTION_ON_BIND", new Object[] { this.idStoreDefinition.getBindDn(), e });
                  throw new IllegalStateException(e);
              }
              try {
                  if (tc.isDebugEnabled()) {
                      Tr.debug(tc, "JNDI_CALL search", new Object[] { searchBase, filter, printControls(controls) });
                  }
                  NamingEnumeration<SearchResult> ne = ctx.search(new LdapName(searchBase), filter, controls);
                  if (ne.hasMoreElements()) {
                      userDn = ne.nextElement().getNameInNamespace();
                      if (ne.hasMoreElements()) {
                          Tr.warning(tc, "JAVAEESEC_WARNING_MULTI_CALLER_LDAP", new Object[] { callerName, filter, searchBase });
                          return null;
                      }
                  }
              } catch (NamingException e) {
                  Tr.error(tc, "JAVAEESEC_ERROR_EXCEPTION_ON_SEARCH", new Object[] { callerName, filter, searchBase, e });
                  throw new IllegalStateException(e);
              }
          }
          return userDn;
      }
docs: Get the caller's full distinguished name (DN). The DN can be returned in one of the following ways:
  
  <ul>
  <li>Using the callerSearchBase, caller's name and the callerBaseDn to form the DN.</li>
  <li>Search in LDAP for the user and returning the DN from the LDAP entry.</li>
  </ul>
  
  @param callerName The caller's name.
  @param filter The filter to search for the caller.
  @param controls The {@link SearchControls} object.
  @return The user's DN.