Skip to content

LDAP Search fails when CN contains brackets ( ) #337

@realroywalker

Description

@realroywalker

I am using LDAP auth with the script server and want to use LDAP groups for restricting access and adding to the admin role.
This works fine on another system I have, but I just tried it with a system that uses ( and ) in the CN attribute for the user, and I'm running into issues with groups not pulling back to the script server.
When I login to script server as a user with the CN "Test User (Test1)" I see the error 'Failed to load groups for the user test user'.

I guess that the ( and ) in the CN are not getting escaped in the search filter? as it's fine if I remove those.
Last part of the error is:-

File "/usr/lib/python3.6/site-packages/ldap3/operation/search.py", line 215, in parse_filter
raise LDAPInvalidFilterError('malformed filter')

Is there any workaround for this? - I have thousands of users with this format of CN.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions