我一直在尝试使用 DEX for LDAP 对 OIDC 进行身份验证。我已成功进行身份验证,但问题是 LDAP 搜索未返回组。以下是我的 DEX 配置和 LDAP 数据。请帮帮我
截图:登录成功,群组为空
我的 Dex 配置
# User search maps a username and password entered by a user to a LDAP entry.
userSearch:
# BaseDN to start the search from. It will translate to the query
# "(&(objectClass=person)(uid=<username>))".
baseDN: ou=People,dc=ec2-54-185-211-121,dc=us-west-2,dc=compute,dc=amazonaws,dc=com
# Optional filter to apply when searching the directory.
#filter: "(objectClass=posixAccount)"
# username attribute used for comparing user entries. This will be translated
# and combine with the other filter as "(<attr>=<username>)".
username: mail
# The following three fields are direct mappings of attributes on the user entry.
# String representation of the user.
idAttr: uid
# Required. Attribute to map to Email.
emailAttr: mail
# Maps to display name of users. No default value.
nameAttr: uid
# Group search queries for groups given a user entry.
groupSearch:
# BaseDN to start the search from. It will translate to the query
# "(&(objectClass=group)(member=<user uid>))".
baseDN: dc=ec2-54-185-211-121,dc=us-west-2,dc=compute,dc=amazonaws,dc=com
# Optional filter to apply when searching the directory.
#filter: "(objectClass=posixGroup)"
# Following two fields are used to match a user to a group. It adds an additional
# requirement to the filter that an attribute in the group must match the user's
# attribute value.
userAttr: uid
groupAttr: memberUid
# Represents group name.
nameAttr: cn
我的 LDAP 数据
dn: ou=People,dc=ec2-54-185-211-121,dc=us-west-2,dc=compute,dc=amazonaws,dc=com ou: People objectClass: organizationsUnit
dn: uid=johndoe,ou=People,dc=ec2-54-185-211-121,dc=us-west-2,dc=compute,dc=amazonaws,dc=com gecos: John Doe uid: johndoe loginShell: /bin/bash mail:john.doe@example.org homeDirectory:/home/jdoe cn:John Doe sn:Doe uidNumber:10002 objectClass:posixAccount objectClass:inetOrgPerson objectClass:top userPassword:bar gidNumber:10002
dn: uid=janedoe,ou=People,dc=ec2-54-185-211-121,dc=us-west-2,dc=compute,dc=amazonaws,dc=com gecos: Jane Doe uid: janedoe loginShell: /bin/bash mail:jane.doe@example.org homeDirectory:/home/jdoe cn:Jane Doe sn:Doe uidNumber:10001 objectClass:posixAccount objectClass:inetOrgPerson objectClass:top userPassword:foo gidNumber:10001
dn: ou=Groups,dc=ec2-54-185-211-121,dc=us-west-2,dc=compute,dc=amazonaws,dc=com ou: Groups objectClass: organizationsUnit
dn: cn=admins,ou=Groups,dc=ec2-54-185-211-121,dc=us-west-2,dc=compute,dc=amazonaws,dc=com cn: admins objectClass: posixGroup objectClass: top gidNumber: 20001 memberUid: janedoe memberUid: johndoe
dn: cn=developers,ou=Groups,dc=ec2-54-185-211-121,dc=us-west-2,dc=compute,dc=amazonaws,dc=com cn: 开发者 objectClass: posixGroup objectClass: top gidNumber: 20002 memberUid: janedoe