![mediawiki:LDAP 驗證錯誤](https://rvso.com/image/1419594/mediawiki%EF%BC%9ALDAP%20%E9%A9%97%E8%AD%89%E9%8C%AF%E8%AA%A4.png)
我正在使用 php5+mysql+ldap 。我已經使用 mediawiki 配置了 php 和 mysql。它工作正常。但我想提供LDAP用戶身份驗證登入以及一般用戶登入。
我安裝了 ldapauthentication 模組 媒體 wiki LDAP 驗證頁面
目前的情況是一般可以在我的mediawiki中建立帳戶,但是作為ldap用戶無法建立。
這裡提供Localsettings.php。
######### edited by RAMKEE ################
require_once( "$IP/extensions/Ldapauthentication/LdapAuthentication.php" );
$wgAuth = new LdapAuthenticationPlugin();
//require_once( "$IP/extensions/Ldapauthentication/LdapAutoAuthentication.php" );
//AutoAuthSetup();
# End of automatically generated settings.
# Add more configuration options below.
$wgLDAPDomainNames = array(
'testADdomain',''
);
$wgLDAPServerNames = array(
'testADdomain' => 'polyproxy.ramkee.local',''
);
$wgLDAPUseLocal = true;
$wgLDAPEncryptionType = array(
'testADdomain' => 'clear',''
);
$wgLDAPOptions = array(
'testADdomain' => array( LDAP_OPT_DEREF, 1)
);
$wgLDAPPort = array(
'testADdomain' => 389,''
);
$wgLDAPSearchStrings = array(
'testADdomain' => 'uid=USER-NAME,ou=people,dc=ramkee,dc=local'.''
);
$wgLDAPSearchAttributes = array(
'testADdomain' => 'uid'
);
$wgLDAPBaseDNs = array(
'testADdomain' => 'dc=LDAP,dc=ramkee,dc=local'
);
$wgLDAPGroupBaseDNs = array(
'testADdomain' => 'ou=group,dc=ramkee,dc=local'
);
$wgLDAPUserBaseDNs = array(
'testADdomain' => 'ou=people,dc=ramkee,dc=local'
);
$wgLDAPWriterDN = array(
'testADdomain' => 'ou=people,dc=ramkee,dc=local'
);
$wgLDAPWriterPassword = array(
'testADdomain' => 'KnfMdMI0qiH9HZBQw7JkqLyEni/wp34x'
);
$wgLDAPWriteLocation = array(
'testADdomain' => 'ou=people,dc=ramkee,dc=local'
);
$wgLDAPAddLDAPUsers = array(
'testADdomain' => true
);
$wgLDAPUpdateLDAP = array(
'testADdomain' => true
);
$wgLDAPRetrievePrefs = array(
'testADdomain' => true
);
$wgLDAPDisableAutoCreate = array(
'testADdomain' => false
);
$wgLDAPDebug = 10000;
$wgMinimalPasswordLength = 1;
$wgLDAPGroupUseFullDN = array( 'testADdomain' => false );
$wgLDAPLowerCaseUsername = array(
'testADdomain' => true
);
$wgLDAPGroupObjectclass = array(
'testADdomain' => 'groupofuniquenames'
);
$wgLDAPGroupUseRetrievedUsername = array( 'testADdomain' => false
);
$wgLDAPGroupNameAttribute = array(
'testADdomain' => 'cn'
);
$wgLDAPGroupsUseMemberOf = array(
'testADdomain' => false
);
$wgLDAPUseLDAPGroups = array(
'testADdomain' => true
);
$wgLDAPGroupsPrevail = array(
'testADdomain' => true
);
#wgLDAPRequiredGroups = array(
# 'testADdomain' => array(
# 'cn=admin,ou=groups,dc=ramkee,dc=local',
# 'cn=chulbul,ou=people,dc=ramkee,dc=local'
# )
#;
每當我嘗試為 ldap 建立帳戶時,它都會顯示您無權更新資料庫。
當以管理員身分登入時,它正在接受(管理員不在 LDAP 中)
我的 ldap 也正在工作,連接埠 389 已打開,並且 ldapsearch -x 也正在工作。但我不知道我哪裡做錯了。一位管理員可以登錄,普通用戶也不能登入。過去三天我一直在掙扎。任何人都可以幫助我
答案1
我發現自己犯了錯誤,這裡提供我的 localsettings.php。如果有人需要它,遵循這個你可能會成功
成功建立 mediawiki 頁面後,您將獲得新的 localsettings.php。只需添加以下幾行即可。然後您將獲得 LDAP 資料庫的身份驗證。
LDAP 資料庫中的使用者無需在我們的 mediawiki 中建立帳戶,他們可以直接登錄,無需建立 wiki 帳戶。
ramkee.local.ismy 域名.多代理.ramkee.local是我的 LDAP 伺服器名稱
require_once 'extensions/LdapAuthentication/LdapAuthentication.php';
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array(
'ramkee.local',
);
$wgLDAPServerNames = array(
'ramkee.local' => 'polyproxy.ramkee.local',
);
$wgLDAPEncryptionType = array(
'ramkee.local' => 'clear',
);
$wgAuthLDAPBindDN = array( 'ramkee.local' => 'cn=admin,dc=ramkee,dc=local');
$wgAuthLDAPBindPassword = array( 'ramkee.local' => 'safesquid');
$wgLDAPPort = array(
'ramkee.local' => 389,
);
$wgLDAPSearchAttributes = array(
'ramkee.local' => 'uid'
);
$wgLDAPBaseDNs = array(
'ramkee.local' => 'dc=ramkee,dc=local',
);
$wgLDAPDebug = 3;
$wgDebugLogGroups["ldap"] = "/tmp/wikildapdebug.log" ;
如果您遇到任何錯誤,請告訴我。謝謝!