OPENLDAP supportedControl上市:1.3.6.1.4.1.42.2.27.8.5.1(密码策略)OPENLDAP supportedControl密码策略
使用.net DirectoryServices.Protocols,我已经用尽提供检索响应信息的所有可能的方法通过这种控制。
我使用的是最新的OpenLDAP源建/在Cygwin环境与构建启用的所有PPolicy相关配置,并配置和工作/测试PPolicy本地运行。
通过从目录服务编程指南修改例如,链接: http://dunnry.com/blog/2006/05/11/DotNetDevGuideToDirectoryServicesCompanionSiteLaunched.aspx
,使用填充有配置为请求
密码策略DirectoryControl一个SearchRequest,让我什么都没有。 一切看起来不错的服务器源: http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob_plain;f=servers/slapd/overlays/ppolicy.c;hb=HEAD
有没有人有使用的.Net DirectoryControls在SearchRequest任何运气?
下面是一些代码,我一直在努力:
_authConnect.AuthType = AuthType.Basic;
// credentials.UserName is a user DN format, w/password and null domain
_authConnect.Credential = credentials;
Debug.WriteLine("PV: " + _authConnect.SessionOptions.ProtocolVersion);
var sr = //new ExtendedRequest();
new SearchRequest(credentials.UserName, "(objectclass=*)", SearchScope.Base, null);
//new DsmlAuthRequest(credentials.UserName);
var isCritical = false;
var ppolicy = "1.3.6.1.4.1.42.2.27.8.5.1";
// ppolicy request and response control is referred to by the same OID
sr.Controls.Add(new DirectoryControl(ppolicy, null, isCritical, true));
sr.Controls.Add(new DirectoryControl(ppolicy, new byte[8], isCritical, false));
try
{
var response = (SearchResponse)_authConnect.SendRequest(sr);
DirectoryControl[] c = response.Controls;
if (c.Rank > 0 && c.GetLength(0) > 0)
{
Debug.WriteLine(c[0].Type + " value: " + c[0].GetValue());
}
SearchResultEntry entry = response.Entries[0];
c = entry.Controls;
if (c.Rank > 0 && c.GetLength(0) > 0)
{
Debug.WriteLine(c[0].Type + " value: " + c[0].GetValue());
}
return true;
}
catch (LdapException ex)
{
Debug.WriteLine(ex.Message);
}
是否确定了身份验证使用设置授权状态(使用绑定)被允许使用该请求控制? – 2011-08-05 16:30:07
没有从输出“的slapd -d -1”表明存在一个权限问题 – ticktock 2011-08-06 14:47:36
我应该更清楚:做目录服务器日志表明,请求失败,因为授权状态不必使用控制权限?顺便说一句,请不要在请求中包含响应控制OID。响应控制(如果存在)显示在来自服务器的响应中。 – 2011-08-08 10:43:35