mod_auth_ldap 和 mod_authnz_ldap 之间的区别
我们使用 LDAP 通过 Apache httpd 进行 Subversion 访问。我们最初让所有用户都可以使用以下命令访问所有 Subversion 存储库:
<Location /src>
DAV svn
SVNParentPath /opt/svn_repos
AuthType basic
AuthName "SVN Repository"
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPURL "ldap://ldap.mycorp.com:3268/dc=mycorp,dc=com?sAMAccountName" NONE
AuthLDAPBindDN "CN=svn_acct,OU=Users,DC=mycorp,DC=com"
AuthLDAPBindPassword "swordfish"
Require valid-user
</Location>
一切都很好。我被要求将 CM 存储库移至其他位置,并使其仅可供 CM 组中的人员访问。我做了以下事情:
<Location /cm>
DAV svn
SVNPath /opt/cm_svn_repos
AuthType basic
AuthName "CM Repository"
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPURL "ldap://ldap.mycorp.com:3268/dc=mycorp,dc=com?sAMAccountName" NONE
AuthLDAPBindDN "CN=svn_acct,OU=Users,DC=mycorp,DC=com"
AuthLDAPBindPassword "swordfish"
Require group CN=cm-group,OU=Groups,DC=mycorp,DC=com
</Location>
我花了几个小时才意识到我使用的是 mod_authnz_ldap 而不是普通的 ol' mod_auth_ldap。因此,我在 Require
语句中需要 ldap-group
而不是 group
。那行得通。
我的同事告诉我,我们使用 mod_authnz_ldap 而不是 mod_auth_ldap 是有原因的,但他不记得为什么了。我们查阅了 Apache httpd 文档,但该文档没有提供任何线索为什么您要使用其中一种而不是另一种。
那么,mod_auth_ldap 和 mod_authnz_ldap 之间有什么区别,为什么要使用其中一个而不是另一个呢?
We use LDAP for Subversion access using Apache httpd. We originally had all of our Subversion repositories accessible by all users using the following:
<Location /src>
DAV svn
SVNParentPath /opt/svn_repos
AuthType basic
AuthName "SVN Repository"
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPURL "ldap://ldap.mycorp.com:3268/dc=mycorp,dc=com?sAMAccountName" NONE
AuthLDAPBindDN "CN=svn_acct,OU=Users,DC=mycorp,DC=com"
AuthLDAPBindPassword "swordfish"
Require valid-user
</Location>
Everything was fine. I was asked to move the CM repository to a different location, and make it accessible for only people in the CM group. I did the following:
<Location /cm>
DAV svn
SVNPath /opt/cm_svn_repos
AuthType basic
AuthName "CM Repository"
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPURL "ldap://ldap.mycorp.com:3268/dc=mycorp,dc=com?sAMAccountName" NONE
AuthLDAPBindDN "CN=svn_acct,OU=Users,DC=mycorp,DC=com"
AuthLDAPBindPassword "swordfish"
Require group CN=cm-group,OU=Groups,DC=mycorp,DC=com
</Location>
I spent a couple of hours on this before realizing that I was using mod_authnz_ldap and not plain ol' mod_auth_ldap. Thus, I needed ldap-group
instead of group
in my Require
statement. That worked.
My coworker informed me that there was a reason why we used mod_authnz_ldap and not mod_auth_ldap, but he couldn't remember why. We looked up the Apache httpd documentation, but the documentation provides no clues why you'd use one over the other.
So, what is the difference between mod_auth_ldap and mod_authnz_ldap, and why would you use one over the other?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
还有谁遇到过这个问题。它与较新版本的 Apache httpd 有关。我的困惑源于httpd 2.1 和2.2 版本之间的变化。由于我有 Apache 2.2,我打算使用新框架:
mod_auth_ldap
适用于 2.2 之前的 Apache 版本mod_authnz_ldap
适用于 Apache 2.2 及更高版本。来自 Apache 2.2 手册
模块增强
Authn/Authz
mod_authnz_ldap
模块开发者更改
Authn/Authz
Anyone else who came across this question. It has to do with the newer versions of Apache httpd. My confusion stemmed from the changes between version 2.1 and 2.2 of httpd. Since I had Apache 2.2, I was suppose to use the new framework:
mod_auth_ldap
is for Apache versions before 2.2mod_authnz_ldap
is for Apache versions 2.2 and later.From the Apache 2.2 Manual
Module Enhancements
Authn/Authz
mod_authnz_ldap
Module Developer Changes
Authn/Authz