To enable LDAP authentication for pgAdmin, you must configure the LDAP
settings in the*config_local.py* or*config_distro.py*file on the system where
pgAdmin is installed in Server mode. You can copy these settings from *config.py*
file and modify the values for the following parameters:
..csv-table::
:header:"**Parameter**", "**Description**"
:class:longtable
:widths:35, 55
"AUTHENTICATION_SOURCES","The default value for this parameter is*internal*.
To enable LDAP authentication, you must include*ldap*in the list of values
for this parameter. you can modify the value as follows:
* [‘ldap’]: pgAdmin will use only LDAP authentication.
* [‘ldap’, ‘internal’]: pgAdmin will first try to authenticate the user through
LDAP. If that authentication fails, then internal user entries of pgAdmin will be used for authentication.
* [‘internal’, ‘ldap’]: pgAdmin will first try to authenticate the user through internal user entries. If that authentication fails, then LDAP authentication will be used."
"LDAP_AUTO_CREATE_USER", "Specifies if you want to automatically create a pgAdmin
user corresponding to the LDAP user credentials. Please note that LDAP password
is not stored in the pgAdmin database."
"LDAP_CONNECTION_TIMEOUT","Specifies the connection timeout (in seconds) for LDAP
authentication."
"LDAP_SERVER_URI", "An LDAP URI is a combination of connection protocol
(ldap or ldaps), IP address/hostname and port of the directory server that you
want to connect to. For example, 'ldap://172.16.209.35:389' is a valid
LDAP_SERVER_URI where ldap is the connection protocol, 172.16.209.35 is the IP
address and 389 is the port. Port 636 is used for the ldaps communication protocol."
"LDAP_BASE_DN","Specifies the base DN from where a server will start the search
for users. For example, an LDAP search for any user will be performed by the server
starting at the base DN (dc=example,dc=com). When the base DN matches, the full
DN (cn=admin,dc=example,dc=com) is used to bind with the supplied password."
"LDAP_USERNAME_ATTRIBUTE","Specifies the LDAP attribute that contains the
usernames. For LDAP authentication, you need to enter the value of that
particular attribute as username. For example, if you set the value of
LDAP_USERNAME_ATTRIBUTE as ‘cn’ and you have defined'cn=admin'in your LDAP server
entries, you should be able to authenticate by entering ‘admin’ in the
*Email Address / Username*field and its corresponding password in the*Password*