Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter by multiple LDAP groups in Flask App Builder using AUTH_LDAP_SEARCH_FILTER

I am configuring the Airflow FAB UI to use LDAP authentication. Currently I have this working, but I can only filter by users who are members of one group in LDAP.

AUTH_LDAP_SEARCH_FILTER = '(memberOf=CN=group1)'

I would like to authenticate users who are in one of two groups. I have tried multiple variations of the below in the webserver_config.py

AUTH_LDAP_SEARCH_FILTER = '|(memberOf=CN=group1)(memberOf=CN=group2)'

but I am always greeted with this error in the Airflow Webserver logs when trying to log in.

ERROR - {`result`: -7, `desc`: `Bad search filter`, `ctrls`: [] }

Is filtering by multiple groups possible within the FAB LDAP framework?

like image 263
Brackl1 Avatar asked Dec 15 '25 04:12

Brackl1


1 Answers

Try adding another set of parentheses inside the quotes to encompass the multiple conditions: AUTH_LDAP_SEARCH_FILTER = '(|(memberOf=CN=group1)(memberOf=CN=group2))'

like image 121
Jenni Avatar answered Dec 16 '25 22:12

Jenni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!