だから別の読み物を読んで、私の質問に私の質問に答えました。
どうやら、ldap_search()、ldap_list()、およびldap_read()の唯一の違いは、スコープ(ldap_scope_subtree(sub)、ldap_scope_onevel(one)、およびldap_scope_base(base))です。したがって、ldap_read()を他のldap_read()を使用すると、rootdseを取得できます。
質問
そう 直接プロジェクト 再びストライクします。私はLDAPの専門家ではありませんが、パッケージによって実装されている方法に関係なく、LDAPとDNS CERTからの証明書の取得をサポートするためのパッケージが必要なため、テスト環境を設定しようとしています。
によると ドキュメント, 、セクション「3.3.3 LDAPクエリ」からの規定された一連のイベント(関連性のためにトリミング):
* Discover the Base DNs
Branches in LDAP must be defined by a “Base DN”. The list of Base DNs that are
provided by a LDAP directory are found by doing a LDAP Query with a NULL (i.e.
“”) Base DN, and ObjectClass=”DN”.
* Query across the Base DN for entries where "Mail" contains the endpoint address
LDAP_*関数を使用して、このプロセスをPHPで実装しようとしていますが、その方法は機能しないようです。明らかに、nullは空の文字列と同じではありません(後者はldap_searchへの呼び出しを「そのようなオブジェクトなし」エラーを返します)、「dn」はObjectClass属性の有効な値ではありません。
だから、tl; dr、匿名のリモートユーザーが私が欠けている(?)ベースdnsを取得する別の方法はありますか?
更新:私の問題の根本原因を反映するようにタイトルを書き直しました:LDAP_* APIが「ベース」スコープを指定できない場合、PHPからrootdseを読む。
解決
だから別の読み物を読んで、私の質問に私の質問に答えました。
どうやら、ldap_search()、ldap_list()、およびldap_read()の唯一の違いは、スコープ(ldap_scope_subtree(sub)、ldap_scope_onevel(one)、およびldap_scope_base(base))です。したがって、ldap_read()を他のldap_read()を使用すると、rootdseを取得できます。
他のヒント
の中に ルートdse. 。 「namingcontexts」を参照してください。
Javaで:
LDAPConnection conn = new LDAPConnection(hostname,port);
SearchRequest req = new SearchRequest("",SearchScope.BASE,"(&)","+");
SearchResult result = conn.search(req);
// If the search succeeds, the result will comprise one entry,
// and that entry is the Root DSE:
dn:
subschemaSubentry: cn=schema
namingContexts: C=us
vendorName: UnboundID Corp.
vendorVersion: UnboundID Directory Server 4.1.0.6