我正在使用Novell.Directory.Ldap库在ldap(使用Oracle Directory Services Enterprise Edition 11.1.1.5的Alcatel Omnivista)中创建用户。
它已经工作了多年,但自从 Omnivista 的最新更新以来,管理员正在解决我创建的用户的问题:对象类的顺序错误。
它应该在哪里
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetorgperson
objectclass: CDPerson
是的:
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
objectclass: top
objectclass: CDPerson
因此,他们的管理应用程序都出错了。
我正在使用以下初始化代码:
LdapAttributeSet attributeSet = new LdapAttributeSet
{
new LdapAttribute("objectclass", "inetOrgPerson"),
new LdapAttribute("cn", new[] {cg.Cn, cg.Cn}),
new LdapAttribute("sn", cg.Sn)
};
我的问题是:
- 这是一个真正的问题吗?顺序重要吗?暗示管理应用程序中存在错误。
- 我可以在创建时更改对象类吗?之后?我应该吗?
- 还是与 ldap 中的配置相关?
多谢!!
在LDAP中,属性(如objectclass)具有一组值,因此顺序无关紧要。
应用程序不应该依赖于值的顺序,所以我会说这是管理应用程序中的错误。
有些服务器确实保留了客户端提供的值顺序,有些则没有,但我不知道该行为在哪里是可配置的。
我设法在创建时更改了对象类,现在应用程序运行良好。尽管如此,我认为该应用程序在某些时候是错误的。
参考代码,如果有一天有人需要它:
LdapAttributeSet attributeSet = new LdapAttributeSet
{
new LdapAttribute("objectclass", new[] {"top", "person", "organizationalPerson", "inetorgperson", "CDPerson"}),
new LdapAttribute("cn", new[] {cg.Cn, cg.Cn}),
new LdapAttribute("sn", cg.Sn),
};