ladp3 获取属性_如何读取ldap3中给定DN的属性(如果没有过滤器,如何使用ldap3进行搜索)...

我刚刚意识到objectClass将始终存在,因此将其设置为通配符应该填充search_filter以返回与基DN相关联的1项:ldap_conn.search(

search_base=my_dn,

search_filter= '(objectClass=*)', # required

search_scope=ldap3.BASE,

attributes='*'

)

然而,在ldap3中没有针对给定DN的连接执行查找操作的特殊情况,这似乎很愚蠢。在

编辑:@cannatag提到这是协议的一个限制,所以我决定检查RFC:(RFC 4511)。显然,ldapsearch和activedirectory模拟x.500样式的列表,或者通过设置objectClass状态过滤器进行读取:Note that an X.500 "list"-like operation can be emulated by the

client requesting a singleLevel Search operation with a filter

checking for the presence of the 'objectClass' attribute, and that an

X.500 "read"-like operation can be emulated by a baseObject Search

operation with the same filter. A server that provides a gateway to

X.500 is not required to use the Read or List operations, although it

may choose to do so, and if it does, it must provide the same

semantics as the X.500 Search operation.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值