Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
对php代码的htaccess ldap身份验证_Php_.htaccess_Authentication_Ldap - Fatal编程技术网

对php代码的htaccess ldap身份验证

对php代码的htaccess ldap身份验证,php,.htaccess,authentication,ldap,Php,.htaccess,Authentication,Ldap,我一直坚持在PHP中使用LDAP身份验证…谷歌搜索了很多论坛,阅读了很多文章,但都没有成功。 也许有人知道解决办法 因此,首先,我有一个通过ApacheHTAccess的工作解决方案作为起点 AuthName "Restricted area" AuthType Basic AuthBasicProvider ldap AuthLDAPURL "ldap://servername.ac.uk:389/ou=ooooo,dc=myusers,dc=mmm,dc=nnn,dc=ooo?cn?sub?

我一直坚持在PHP中使用LDAP身份验证…谷歌搜索了很多论坛,阅读了很多文章,但都没有成功。 也许有人知道解决办法

因此,首先,我有一个通过ApacheHTAccess的工作解决方案作为起点

AuthName "Restricted area"
AuthType Basic
AuthBasicProvider ldap
AuthLDAPURL "ldap://servername.ac.uk:389/ou=ooooo,dc=myusers,dc=mmm,dc=nnn,dc=ooo?cn?sub?(objectClass=person)"
AuthLDAPBindDN "cn=tttt,ou=Users,dc=myusers,dc=mmm,dc=nnn,dc=ooo"
AuthLDAPBindPassword "xxxxxxx"

# Must be in one of these groups to access the web pages:
require ldap-group CN=staff1,OU=Group1,DC= myusers,DC= mmm,DC= nnn,DC= ooo
require ldap-group CN=staff2,OU=Group2,DC= myusers,DC= mmm,DC= nnn,DC= ooo
htaccess成功检查用户是否属于某个组并对其进行身份验证

然而,我想将其转换为PHP,但对LDAP没有太多的了解,所以不知道如何将其转换为PHP代码

提前谢谢。

这个能帮你吗。。