Unable to connect two LDAP servers at a time with Apache-Superset application

1k views Asked by At

I am trying to configure Superset with multiple ldap servers, but at this moment, I was able to setup for only one server.

Any work around that can be done in the 'Config.py' to configure multiple servers at a same time??

I have given the following configuration in the ‘config.py’ file.

config.py - LDAP configs

AUTH_TYPE = AUTH_LDAP    
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Alpha"

AUTH_LDAP_SERVER = "ldap://ldap_example_server_one:389"
AUTH_LDAP_USE_TLS = False
AUTH_LDAP_BIND_USER = "CN=my_user,OU=my_users,DC=my,DC=domain"
AUTH_LDAP_BIND_PASSWORD = "mypassword"
AUTH_LDAP_SEARCH = "DC=my,DC=domain"
AUTH_LDAP_UID_FIELD = "sAMAccountName"

Note – It worked for ‘ldap_example_server_one:389’ server but when tried to add another server it threw an Configuration failure error.

1

There are 1 answers

0
Aleksandr Gordienko On

You can't use multiple LDAP servers with default LDAP authenticator from Flask Appbuilder. You have to implement your own custom security manager which will be able to operate as many LDAP servers as you want.

At first, you should create new file, e.g. my_security_manager.py. Put these lines into it:

from superset.security import SupersetSecurityManager


class MySecurityManager(SupersetSecurityManager):
    
    def __init__(self, appbuilder):
        super(MySecurityManager, self).__init__(appbuilder)

Secondly, you should let Superset know that you want to use your brand new security manager. To do so, add these lines to your Superset configuration file (superset_config.py):

from my_security_manager import MySecurityManager
CUSTOM_SECURITY_MANAGER = MySecurityManager