
cx8wp (cx8wp) asked a question.
Hi,
trying to search user with custom attribute which has uderscore (_) in its name.
Search is failing with ldap_search_ext: Bad search filter (-7)
Example:
ldapsearch -D "uid=venkat@gmail.com,dc=datahub-poc,dc=okta,dc=com" -w "" -h test-poc.ldap.okta.com -b "dc=test-poc,dc=okta,dc=com" -s sub -x -ZZ "(Internal_User_Name=venkat@gmail.com)"
Custom atrribute: Internal_User_Name

Hi Venkatesh,
Thank you to contact Okta.
Just a small detail to your question, it is out of Okta scope.
Let's try to help you.
There is a limitation with LDAP name convention. LDAP convention does not support underscores in the attribute descriptors that is why it returns a syntax error.
Also, I found similar cases on Internet:
https://knowledge.broadcom.com/external/article/15476/dxsearch-fails-with-bad-search-filter-er.html
https://ff1959.wordpress.com/2012/03/04/characters-that-are-permitted-in-attribute-names-descriptors/
You can try the recommendation mentioned in the previous link, looks that the encoded value could be supported to try with this value.
https://docs.ldap.com/specs/rfc4512.txt
https://docs.oracle.com/cd/B14099_19/idmanage.1012/b15883/syntax_datamngmnt013.htm