フォレスト間で信頼関係を確立している複数のADサーバーがあるため、異なるドメインのWindowsユーザーは制限されたリソースにアクセスできます。 domainA.comとdomainB.comがあると仮定して、ドメインdomainB.comのどのユーザーもdomainA.comのリソースにログインできます。セキュリティ上の理由から、管理者はLDAPサーバーへの匿名アクセスを無効にします。信頼できるドメインの資格情報を使用してPHPでADサーバーにバインドするにはどうすればよいですか?
OpenLDAPクライアントの助けを借りて、すべてのLDAPサーバーのすべてのユーザーをPHPコードでリストする必要があります。以下は、PHPコードはdomainB.com
define('USER', '[email protected]'); // User from domainA.com here
$ldap = ldap_connect('domainB.com') or die('Bad connection');
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
ldap_bind($ldap, USER, PASS) or die('Cannot bind');
からすべてのユーザーに関する情報を取得することである私のスクリプトがメッセージのLDAPエラーで「49の無効な資格情報を」「バインドできません」と死にます。 ADからの追加情報:
80090308:LdapErr:DSID-0C0903A9、コメント:AcceptSecurityContextエラー、データ部52e、v1db1
私はGSSを使用する場合、LDAP管理者に認証をネゴシエートするので、問題は、単純な認証機構であることを考えます[email protected]と同じ資格情報を持つクライアントはすべて問題ありません。
[email protected]からの資格情報を使用してdomainB.comでバインドを成功させるにはどうすればよいですか? SASL DIGEST-MD5と
UPD1認証ADから
ldap_sasl_bind ($ldap, '', $pass, 'DIGEST-MD5', null, '[email protected]');
ログ:
The computer attempted to validate the credentials for an account. Authentication Package: WDigest Logon Account: user Source Workstation: DOMAINA Error Code: 0xc000006a An account failed to log on. Subject: Security ID: NULL SID Account Name: - Account Domain: - Logon ID: 0x0 Logon Type: 3 Account For Which Logon Failed: Security ID: NULL SID Account Name: [email protected] Account Domain: domainA.com Failure Information: Failure Reason: An Error occured during Logon. Status: 0xc000006d Sub Status: 0xc000006d Process Information: Caller Process ID: 0x0 Caller Process Name: - Network Information: Workstation Name: - Source Network Address: Source Port: Detailed Authentication Information: Logon Process: WDIGEST Authentication Package: WDigest Transited Services: - Package Name (NTLM only): - Key Length: 0 This event is generated when a logon request fails. It is generated on the computer where access was attempted. The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe. The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network). The Process Information fields indicate which account and process on the system requested the logon. The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases. The authentication information fields provide detailed information about this specific logon request. - Transited services indicate which intermediate services have participated in this logon request. - Package name indicates which sub-protocol was used among the NTLM protocols.
"CN = user、OU = Special Users、DC = domainA、DC = com"というユーザーDNでバインドしようとしましたが、 "無効な資格情報"です。グローバルカタログは興味深いですが、それは私のためにも機能しません。 – lisachenko
単純なバインドを使用すると、DomainBディレクトリのユーザーとバインドする必要があります。 DomainAユーザーとバインドするにはSALSを使用する必要があります – JPBlanc
PHPにSASLバインディング用のldap_sasl_bind()関数がありますが、KerberosまたはNTLM認証の作成方法がわかりません。 PHPコードからSASL認証の経験がありますか? – lisachenko