openldap代理授权

我在使用代理授权进行更新时遇到了一些麻烦。 我正在使用UnboundID的LDAP SDK连接到OpenLDAP,并为更新发送dn: uid=me,dc=People,dc=example,dc=com的ProxiedAuthorizationV2RequestControl 。 我已经testing并validation目标用户有权执行该操作,但是我得到了

访问权限不足

当我尝试通过代理身份validation。

我已经在原始用户的cn=configauthzTo={0}ldap:///dc=people,dc=example,dc=com??subordinate?(objectClass=inetOrgPerson) cn=config authzTo={0}ldap:///dc=people,dc=example,dc=com??subordinate?(objectClass=inetOrgPerson) authzTo似乎正在工作; 当我改变它我得到

没有被授权承担身份

当我尝试更新(也用于search)。


我有这个ldapwhoami -U portal -Y DIGEST-MD5 -X u:mace -H ldap://yorktown -Z现在没有saslauthd工作。 我只需要将代理用户(门户)的密码存储为纯文本。 但是,当我尝试更新任何东西时,我仍然没有“访问权限不足”。

代理用户

 dn: uid=portal,ou=Special Accounts,dc=example,dc=com objectClass: inetOrgPerson cn: portal sn: portal uid: portal userPassword: test authzTo: {0}ldap:///dc=People,dc=example,dc=com??sub?(objectClass=inetOrgPerson) 

有效的用户:

 dn: employeeNumber=1400,dc=People,dc=example,dc=com objectClass: inetOrgPerson objectClass: posixAccount objectClass: sambaSamAccount objectClass: shadowAccount uid: mace ... 

这是更新尝试的日志,试图添加employeeNumber=1385作为cn=Data Managementmember 。 它似乎正确地查看嵌套组,但它似乎应该指示匹配,一旦它获得cn=administrators employeeNumber = 1400。

 op tag 0x66, time 1299022001 conn=31595 op=2 do_modify conn=31595 op=2 do_modify: dn (cn=Data Management,dc=Roles,dc=example,dc=com) >>> dnPrettyNormal: <cn=Data Management,dc=Roles,dc=example,dc=com> <<< dnPrettyNormal: <cn=Data Management,dc=Roles,dc=example,dc=com>, <cn=data management,dc=roles,dc=example,dc=com> conn=31595 op=2 modifications: replace: member multiple values conn=31595 op=2 MOD dn="cn=Data Management,dc=Roles,dc=example,dc=com" conn=31595 op=2 MOD attr=member >>> dnPretty: <employeeNumber=1020,dc=People,dc=example,dc=com> <<< dnPretty: <employeeNumber=1020,dc=People,dc=example,dc=com> >>> dnPretty: <employeeNumber=1385,dc=People,dc=example,dc=com> <<< dnPretty: <employeeNumber=1385,dc=People,dc=example,dc=com> >>> dnNormalize: <employeeNumber=1020,dc=People,dc=example,dc=com> <<< dnNormalize: <employeeNumber=1020,dc=people,dc=example,dc=com> >>> dnNormalize: <employeeNumber=1385,dc=People,dc=example,dc=com> <<< dnNormalize: <employeeNumber=1385,dc=people,dc=example,dc=com> dnMatch -1 "employeeNumber=1020,dc=people,dc=example,dc=com" "employeeNumber=1385,dc=people,dc=example,dc=com" bdb_dn2entry("cn=data management,dc=roles,dc=example,dc=com") ==> unique_modify <cn=Data Management,dc=Roles,dc=example,dc=com> bdb_modify: cn=Data Management,dc=Roles,dc=example,dc=com bdb_dn2entry("cn=data management,dc=roles,dc=example,dc=com") bdb_modify_internal: 0x00000043: cn=Data Management,dc=Roles,dc=example,dc=com >>> dnNormalize: <cn=Administrators,ou=LDAP,dc=Applications,dc=example,dc=com> <<< dnNormalize: <cn=administrators,ou=ldap,dc=applications,dc=example,dc=com> => bdb_entry_get: ndn: "cn=administrators,ou=ldap,dc=applications,dc=example,dc=com" => bdb_entry_get: oc: "(null)", at: "member" bdb_dn2entry("cn=administrators,ou=ldap,dc=applications,dc=example,dc=com") bdb_entry_get: rc=0 >>> dnNormalize: <cn=system administrators,dc=roles,dc=example,dc=com> <<< dnNormalize: <cn=system administrators,dc=roles,dc=example,dc=com> => bdb_entry_get: ndn: "cn=system administrators,dc=roles,dc=example,dc=com" => bdb_entry_get: oc: "(null)", at: "member" bdb_dn2entry("cn=system administrators,dc=roles,dc=example,dc=com") bdb_entry_get: rc=0 >>> dnNormalize: <employeeNumber=1306,dc=people,dc=example,dc=com> <<< dnNormalize: <employeeNumber=1306,dc=people,dc=example,dc=com> => bdb_entry_get: ndn: "employeeNumber=1306,dc=people,dc=example,dc=com" => bdb_entry_get: oc: "(null)", at: "member" bdb_dn2entry("employeeNumber=1306,dc=people,dc=example,dc=com") bdb_entry_get: rc=16 >>> dnNormalize: <employeeNumber=1329,dc=people,dc=example,dc=com> <<< dnNormalize: <employeeNumber=1329,dc=people,dc=example,dc=com> => bdb_entry_get: ndn: "employeeNumber=1329,dc=people,dc=example,dc=com" => bdb_entry_get: oc: "(null)", at: "member" bdb_dn2entry("employeeNumber=1329,dc=people,dc=example,dc=com") bdb_entry_get: rc=16 >>> dnNormalize: <employeeNumber=1401,dc=people,dc=example,dc=com> <<< dnNormalize: <employeeNumber=1401,dc=people,dc=example,dc=com> => bdb_entry_get: ndn: "employeeNumber=1401,dc=people,dc=example,dc=com" => bdb_entry_get: oc: "(null)", at: "member" bdb_dn2entry("employeeNumber=1401,dc=people,dc=example,dc=com") bdb_entry_get: rc=16 >>> dnNormalize: <employeeNumber=1400,dc=people,dc=example,dc=com> <<< dnNormalize: <employeeNumber=1400,dc=people,dc=example,dc=com> => bdb_entry_get: ndn: "employeeNumber=1400,dc=people,dc=example,dc=com" => bdb_entry_get: oc: "(null)", at: "member" bdb_dn2entry("employeeNumber=1400,dc=people,dc=example,dc=com") bdb_entry_get: rc=16 bdb_modify: modify failed (50) send_ldap_result: conn=31595 op=2 p=3 send_ldap_result: err=50 matched="" text="" send_ldap_response: msgid=3 tag=103 err=50 conn=31595 op=2 RESULT tag=103 err=50 text= 

大约一年前,我经历了这个,代理授权使我疯狂。 所以我可能没有明确的答案,但也许我可以帮忙。

首先:在slapd上增加你的日志级别! 这是冗长的,但它有帮助。 其次:使用ldapwhoami来testing代理授权。 您可以使用-X选项指定目标用户,并使用-U指定代理用户。

 # ldapwhoami -U proxyuser -Y DIGEST-MD5 -X u:targetuser -H ldap://localhost 

您应该在configuration中启用两个参数。 olcAuthzPolicy (你有)和olcAuthzRegexp (用于构buildSASLauthenticationstring)。 这里是我的configuration:

 olcAuthzRegexp: "^uid=([^,]+).*,cn=[^,]*,cn=auth$" "ldap:///dc=example,dc=net??sub?(uid=$1)" olcAuthzPolicy: to 

最后,正如你所说的,你的proxyuser应该有一个authzTo属性。 这里是我的一个代理用户的定义:

 dn: cn=proxyuser,dc=example,dc=net uid: proxyuser mail: [email protected] sn: proxyuser cn: proxyuser objectClass: inetOrgPerson objectClass: top structuralObjectClass: inetOrgPerson authzTo: {0}ldap:///dc=example,dc=net??sub?(objectClass=inetOrgPerson) userPassword:: iodqwhdowihw0123hef92e= 

现在,这应该足以使代理授权工作(再一次,testing它与ldapwhoami)。 我已经在我的wiki(SASL和代理授权)上写了一章,因为我需要它从cyrus-imapd和postfix连接到openldap。 欲了解更多信息,请看看它: http : //wiki.linuxwall.info/doku.php/en : ressources : dossiers : openldap : openldap_debian#sasl

在Julien的帮助下解决了几个configuration问题之后,我发现了UnboundID LDAP SDK v2.0.0中的一个bug,这显然会导致修改请求在不受控制的情况下被发送。 我在他们的论坛中得到了很好的支持 ,他们在我发布日志的几个小时内为我提供了一个新的版本,用于识别问题,听起来好像它将在2.1.0版本中得到修复。 现在我的代码正在按预期工作。