Active Directory authentication for PostgreSQL users

It is easy, you just need to add to the configuration file /var/lib/postgresql/data/pg_hba.conf host all all ldap ldapserver="myldapserver" ldapbasedn="OU=USERS,DC=group,DC=redaelli,DC=org" ldapbinddn="CN=matteo,OU=USERS,DC=group,DC=redaelli,DC=org" ldapbindpasswd="MySillyPwd" ldapsearchattribute="sAMAccountName" ldapscheme="ldaps" And inside your database yu need to create a role for the Active director users and then grant them to the required databases.

October 12, 2020 · 1 min · 47 words · Matteo Redaelli