I'm attempting to configure my Postgresql server 12.6 [Ubuntu 20.04 build] to do authenticated LDAP user authentication against my 2012 Active Directory tree via LDAP. I've set up my pg_hba.conf file here is my most recent attempt. I've also tried the ldapserver style setup and both get the same error results.
host all all all ldap ldapurl="ldap://stc.int:389/dc=stc,dc=int?sAMAccountName" ldapbinddn="CN=PostgreSQL Service Account,OU=Service Accounts,DC=stc,DC=int" ldapbindpasswd="<scrubed>"
When I try to log in, I get the following errors on the server:
2021-05-26 12:47:00.008 UTC [2767782] btyger-admin@btyger-admin LOG: could not search LDAP for filter "(sAMAccountName=btyger-admin)" on server "stc.int": Operations error 2021-05-26 12:47:00.008 UTC [2767782] btyger-admin@btyger-admin DETAIL: LDAP diagnostics: 000004DC: LdapErr: DSID-0C0907E9, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v2580 2021-05-26 12:47:00.008 UTC [2767782] btyger-admin@btyger-admin FATAL: LDAP authentication failed for user "btyger-admin" 2021-05-26 12:47:00.008 UTC [2767782] btyger-admin@btyger-admin DETAIL: Connection matched pg_hba.conf line 106: "host all all all ldap ldapurl="ldap://stc.int:389/dc=stc,dc=int?sAMAccountName" ldapbinddn="CN=PostgreSQL Service Account,OU=Service Accounts,DC=stc,DC=int" ldapbindpasswd="<scrubed>"" I know that AD error happens when an LDAP client tries to do an unauthenticated search. I've verified the credentials with a ldapsearch command from the same machine and the parameter/credentials verify correctly.
Am I missing something here or am I seeing a bug?