简体   繁体   English

OpenLDAP ldap_get_option()响应

[英]OpenLDAP ldap_get_option() response

I'm working on OpenLDAP password policy implementation to app. 我正在将OpenLDAP密码策略实施到应用程序。 I'm trying to get password is expiring, password expired notifications from OpenLDAP. 我正在尝试获取密码即将到期,OpenLDAP的密码已过期通知。

I set the current value 我设置当前值

$ppolicy_control = array("oid" => "1.3.6.1.4.1.42.2.27.8.5.1","iscritical" => true);

with ldap_set_option() for LDAP_OPT_SERVER_CONTROLS (password policy control) ldap_set_option()用于LDAP_OPT_SERVER_CONTROLS (密码策略控制)

I still don't get the password policy response from ldap_get_option() . 我仍然没有从ldap_get_option()获得密码策略响应。

What I have learned, that OpenLDAP C API hasn't implemented LDAP_OPT_SERVER_CONTROLS case on ldap_get_option() method. 我了解到,OpenLDAP C API尚未在ldap_get_option()方法上实现LDAP_OPT_SERVER_CONTROLS情况。 Checking the packets on Wireshark shows the ppolicy response hooked to the packet. 检查Wireshark上的数据包显示挂钩到该数据包的策略响应。

Is there any workaround to pull the password policy response from OpenLDAP using PHP or OpenLDAP C API? 有什么解决方法可以使用PHP或OpenLDAP C API从OpenLDAP中提取密码策略响应?

use ldap_control_find() API and macro LDAP_CONTROL_PASSWORDPOLICYRESPONSE pass the same to ldap_parse_passwordpolicy_control() API to get the ppolicy response from the LDAP server 使用ldap_control_find()API和宏LDAP_CONTROL_PASSWORDPOLICYRESPONSE将其传递给ldap_parse_passwordpolicy_control()API,以从LDAP服务器获取策略请求

pseudo code 伪码

ctrl = ldap_control_find( LDAP_CONTROL_PASSWORDPOLICYRESPONSE) ctrl = ldap_control_find(LDAP_CONTROL_PASSWORDPOLICYRESPONSE)

call ldap_parse_passwordpolicy_control(ppolicyinfo.expire ,ppolicyinfograce) 调用ldap_parse_passwordpolicy_control(ppolicyinfo.expire,ppolicyinfograce)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM