Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LDAP authentication seems to fail when login_filter matches for memberOf #529

@funkpunkt

Description

@funkpunkt
# config.yaml auth section
auth:
  ldap:
    - provider_name: ldap_example
      url: ldaps://ucs.example.com:636
      start_tls: false
      cert_validation: false
      base_dn: dc=example,dc=com
      bind_user: [email protected]
      bind_pass: bindPassword
      field_map:
        user_identifier: sAMAccountName
        email: mail
        firstname: givenName
        lastname: sn
        memberof: memberOf
      login_filter: (&(objectClass=organizationalPerson)(sAMAccountName={{login_identifier}})(memberOf=CN=vpn,CN=Groups,DC=example,DC=com))
      admin_group: CN=Administrators,CN=Builtin,DC=example,DC=com
      disable_missing: true
      auto_re_enable: true
      registration_enabled: true
user1 failed to login: ldap provider not found

Describe the bug
LDAP authentication fails when a memberOf filter is included in the filter expression. According to the event log wg-portal seems to be unable to query the LDAP service properly. The same filter expression works fine with ldapsearch command.

Expected behavior
wg-portal should process the filter expression correctly

Steps to reproduce
add a corresponding memberOf filter to your working filter expression

Screenshots
n/a

Additional context

  • Application version: v2.0.5-0cc7ebb
  • Install method: docker compose with lscr.io/linuxserver/wireguard:latest
  • OS: Ubuntu Server 24.04

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions