cn=%v处的LDAP用户筛选器错误
在Gitlab的LDAP设置中,我使用cn=%v处的LDAP用户筛选器错误,ldap,gitlab,Ldap,Gitlab,在Gitlab的LDAP设置中,我使用 user\u filter:'(memberof=CN=%v,OU=groupname,DC=company,DC=local) 但这给了我一个错误: 格式错误的格式字符串-%v 我可以为CN中的用户名提供什么格式的筛选器正如中所述,语法只应如下: 在您的情况下,CN应该是一个组的名称,而不是像%v这样的占位符 请看一个例子 您可以使用以下工具进行测试: 尝试在不使用筛选器集的情况下通过Rails控制台运行此查询集,然后使用筛选器集运行此查询集。 使用su
user\u filter:'(memberof=CN=%v,OU=groupname,DC=company,DC=local)
但这给了我一个错误:
格式错误的格式字符串-%v
我可以为CN
中的用户名提供什么格式的筛选器正如中所述,语法只应如下:
在您的情况下,CN应该是一个组的名称,而不是像%v
这样的占位符请看一个例子 您可以使用以下工具进行测试: 尝试在不使用筛选器集的情况下通过Rails控制台运行此查询集,然后使用筛选器集运行此查询集。
使用sudogitlab Rails控制台启动Rails控制台
adapter=Gitlab::LDAP::adapter.new('ldapmain'))
person=Gitlab::LDAP::person.find_by_uid(“”,适配器)
个人会员
NameError:Uninitialized constant LDAP::Adapter我看到了一个MSDN页面,并将v
用作通用用户名。我错了好吧,你最后用了什么?
# Filter LDAP users
#
# Format: RFC 4515 https://tools.ietf.org/search/rfc4515
# Ex. (employeeType=developer)
#
# Note: GitLab does not support omniauth-ldap's custom filter syntax.
#
# Example for getting only specific users:
# '(&(objectclass=user)(|(samaccountname=momo)(samaccountname=toto)))'
#
user_filter: ''
adapter = Gitlab::LDAP::Adapter.new('ldapmain')
person = Gitlab::LDAP::Person.find_by_uid('<username>', adapter)
person.memberof