我是 LDAP 的初学者。谁能告诉我此 LDAP 连接字符串中的域名是什么:
connectionString="LDAP://AD/dc=Demo, dc=Local"
Run Code Online (Sandbox Code Playgroud)
是还是AD还是?DemoLocal
我遇到过这样的情况:Active Directory 组以唯一代码为前缀。例如
我目前正在使用 LDAP 来获取所有组,但我想将其限制为仅包含以 id 为前缀的组。
有效获取以 12345 开头的组。
如何使用 LDAP 实现这一目标?
我们已经在 tomcat 中配置了 ldap 设置。这些天它工作正常。但突然出现 ldap 错误。以下错误的含义是什么。
这是在 tomcat 配置文件中设置的 ldap 配置。
Jul 19, 2016 11:14:04 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Context/Realm} Setting property 'debug' to '99' did not find a matching property.
Jul 19, 2016 11:14:04 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Context/Realm} Setting property 'curUserPattern' to '%s@corp' did not find a matching property.
Jul 19, 2016 11:14:04 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Context/Realm} Setting property 'resourceName' to 'add_web_realm' did not find a matching property.
Jul 19, 2016 11:14:05 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: …Run Code Online (Sandbox Code Playgroud) 我编写了以下 ldap 命令来测试 ldap 连接
ldapsearch -x -h ldap.com -b "uid=user1,ou=people,dc=domain,dc=com"
Run Code Online (Sandbox Code Playgroud)
我得到以下输出
# extended LDIF
#
# LDAPv3
# base <uid=user1,ou=people,dc=domain,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# search result
search: 2
result: 1 Operations error
text: 000004DC: LdapErr: DSID-0C0907C2, comment: In order to perform this opera
tion a successful bind must be completed on the connection., data 0, v2580
# numResponses: 1
Run Code Online (Sandbox Code Playgroud)
请建议如何解决绑定错误
我正在尝试使用 django-ldapdb 库来显示用户的 LDAP 属性。首先我做了一个新模型:
模型.py
class LdapUser(ldapdb.models.Model):
base_dn = u"CN=XXX,CN=Users,DC=domain,DC=com"
object_classes = ['posixAccount', 'shadowAccount', 'inetOrgPerson']
# inetOrgPerson
phone = CharField(db_column='telephoneNumber', blank=True)
mobile_phone = CharField(db_column='mobile', blank=True)
Run Code Online (Sandbox Code Playgroud)
我想用表单在我的 webapp 中显示这些。
class LdapUserForm(ldapdb.models.Model):
class Meta:
model = LdapUser
fields = (
'phone',
'mobile_phone'
)
Run Code Online (Sandbox Code Playgroud)
我做了所有的迁移,但是当我运行我的代码时,它给了我以下错误。
raise TypeError("'class Meta' 的属性无效:%s" % ','.join(meta_attrs.keys())) TypeError:'class Meta' 的属性无效:字段,模型
我查了一下,但找不到任何有用的东西。所以我希望 stacko 上有人为我提供解决方案。
提前致谢
我无法使用真实的活动目录进行身份验证,让我更好地解释一下我尝试使用 spring.io 提出的示例进行身份验证,没有问题,内部服务启动没有任何问题。参考https://spring.io/guides/gs/authenticating-ldap/
我试图通过插入我的活动目录的配置来修改下面的代码,但没有成功。您能否指导我或向我展示一个真实的案例,在不使用示例中的内部服务的情况下建立真正的连接?我在网上查看,但发现一切都与官方示例相似,没有任何实际案例
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userDnPatterns("uid={0},ou=people")
.groupSearchBase("ou=groups")
.contextSource()
.url("ldap://localhost:8389/dc=springframework,dc=org")
.and()
.passwordCompare()
.passwordEncoder(new LdapShaPasswordEncoder())
.passwordAttribute("userPassword");
}
Run Code Online (Sandbox Code Playgroud)
错误显示:LDAP处理过程中出现未分类异常;嵌套异常是 javax.naming.NamingException: [LDAP: error code 1 - 000004DC: LdapErr: DSID-0C0907C2, comment: 为了执行此操作,必须在连接上完成成功的绑定。, data 0, v2580
我在我的OpenLDAP服务器中使用服务器端排序.然而,由于我也编写了客户端代码,我可以看到它只是在这种情况下购买了我在客户端的一行排序代码.而且由于客户端是目前的4个,很快就会有16个Tomcats,如果使用气球,可能会有数百个,在客户端进行排序实际上对我来说更有意义.我想知道SSS是否真的被认为是一个想法.我在这种情况下的搜索结果并不大,数十而不是数百.只是想知道它是否可能更像武器而不是工具.
在OpenLDAP中,它与VLV捆绑在一起 - 虚拟列表视图,我有一天会需要它,因此它已经安装:所以它确实是一个编程问题,而不仅仅是一个配置问题,因此SO不是SF.
ldap ×7
ldap-query ×2
.net ×1
asp.net ×1
bind ×1
c# ×1
django ×1
django-forms ×1
linux ×1
openldap ×1
python ×1
selinux ×1
spring ×1
spring-ldap ×1