Skip to content

Commit

Permalink
default filter to match different AD types
Browse files Browse the repository at this point in the history
  • Loading branch information
byewokko committed Sep 17, 2024
1 parent 38c7399 commit 65f566d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions seacatauth/credentials/providers/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class LDAPCredentialsProvider(CredentialsProviderABC):
"username": "cn=admin,dc=example,dc=org",
"password": "admin",
"base": "dc=example,dc=org",
"filter": "(&(objectClass=inetOrgPerson)(cn=*))",
"filter": "|(objectClass=organizationalPerson)(objectClass=inetOrgPerson)",
"attributes": "mail mobile userAccountControl displayName",

# Path to CA file in PEM format
Expand Down Expand Up @@ -85,7 +85,9 @@ def __init__(self, provider_id, config_section_name, proactor_svc):

self.LdapUri = self.Config["uri"]
self.Base = self.Config["base"]
self.Filter = self.Config["filter"]
self.Filter: str = self.Config["filter"]
if not (self.Filter.startswith("(") and self.Filter.endswith(")")):
self.Filter = "({})".format(self.Filter)
self.AttrList = _prepare_attributes(self.Config)

# Fields to filter by when locating a user
Expand Down

0 comments on commit 65f566d

Please sign in to comment.