From 4b202c052c93d74809c365a991852a339264b24a Mon Sep 17 00:00:00 2001 From: Dragos Andriciuc Date: Wed, 1 Oct 2025 15:52:16 +0300 Subject: [PATCH 1/3] Update LDAP topic - remade intro paragraph - added basic LDAP set up to include ldap auth method in hba config - added links to upstream docs throughout topic for user to check out parameters and commands --- docs/ldap.md | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/docs/ldap.md b/docs/ldap.md index 03ae6c1ba..cfd661909 100644 --- a/docs/ldap.md +++ b/docs/ldap.md @@ -1,7 +1,32 @@ -# LDAP Authentication +# LDAP authentication -When a client application or a user that runs the client application connects to the database, it must identify themselves. The process of validating the client's identity and determining whether this client is permitted to access the database it has requested is called **authentication**. +Percona's PostgreSQL allows you to use LDAP, which uses a central authentication server for storing usernames, passwords and their resource permissions. -Percona Distribution for PortgreSQL supports several [authentication methods :octicons-link-external-16:](https://www.postgresql.org/docs/{{pgversion}}/auth-methods.html), including the [LDAP authentication :octicons-link-external-16:](https://www.postgresql.org/docs/{{pgversion}}/auth-ldap.html). The use of LDAP is to provide a central place for authentication - meaning the LDAP server stores usernames and passwords and their resource permissions. +The LDAP authentication method in Percona Distribution for PortgreSQL is functionally the same as upstream PostgreSQL, check the documentation [here :octicons-link-external-16:](https://www.postgresql.org/docs/{{pgversion}}/auth-ldap.html) for more information. -The LDAP authentication in Percona Distribution for PortgreSQL is implemented the same way as in upstream PostgreSQL. \ No newline at end of file +## Set up LDAP authentication + +Follow these steps to set up LDAP authentication for your PostgreSQL database. + +1. Add in the `pg_hba.conf` file (usually located in `/data/db/...`) the `ldap` authentication method. For example: + + ```ini + host all all 192.168.1.0/24 ldap ldapserver=ldap.example.com ldapport=389 ldapbinddn="cn=admin,dc=example,dc=com" ldapbindpasswd="password" + ``` + +2. Add or modify the LDAP configuration parameters (`ldapbindpasswd`, `ldapbinddn`, and so on) in your `postgresql.conf` file. + + !!! tip + You can directly add the parameters using the `ALTER SYSTEM` command in the psql command line. See a more in-depth list of LDAP configuration parameters [here :octicons-link-external-16:](https://www.postgresql.org/docs/{{pgversion}}/auth-ldap.html). + +3. Restart your PostgreSQL service to apply the changes. + +4. Connect to your database as a superuser and create the roles that correspond to groups or users in your LDAP directory. For example: + + ```sql + CREATE ROLE important_users WITH LOGIN; + ``` + +5. Grant appropriate permissions to these roles using [standard SQL GRANT statements :octicons-link-external-16:](https://www.postgresql.org/docs/18/sql-grant.html). + +By following these steps, you have successfully integrated LDAP authentication into your environment. From 883076551d410ff029ae59a4945ce9ceaa63247e Mon Sep 17 00:00:00 2001 From: Dragos Andriciuc Date: Wed, 1 Oct 2025 16:55:14 +0300 Subject: [PATCH 2/3] Update ldap.md removed superfluous example --- docs/ldap.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/ldap.md b/docs/ldap.md index cfd661909..49c268e1d 100644 --- a/docs/ldap.md +++ b/docs/ldap.md @@ -21,11 +21,7 @@ Follow these steps to set up LDAP authentication for your PostgreSQL database. 3. Restart your PostgreSQL service to apply the changes. -4. Connect to your database as a superuser and create the roles that correspond to groups or users in your LDAP directory. For example: - - ```sql - CREATE ROLE important_users WITH LOGIN; - ``` +4. Connect to your database as a superuser and create the roles that correspond to groups or users in your LDAP directory. 5. Grant appropriate permissions to these roles using [standard SQL GRANT statements :octicons-link-external-16:](https://www.postgresql.org/docs/18/sql-grant.html). From 6099c8b7615a3f2ea32394a42de137c306b960b4 Mon Sep 17 00:00:00 2001 From: Dragos Andriciuc Date: Wed, 1 Oct 2025 17:05:47 +0300 Subject: [PATCH 3/3] Update ldap.md added visual update for buttons to be clearer/bigger --- docs/ldap.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/ldap.md b/docs/ldap.md index 49c268e1d..879aa696a 100644 --- a/docs/ldap.md +++ b/docs/ldap.md @@ -7,6 +7,7 @@ The LDAP authentication method in Percona Distribution for PortgreSQL is functio ## Set up LDAP authentication Follow these steps to set up LDAP authentication for your PostgreSQL database. +{.power-number} 1. Add in the `pg_hba.conf` file (usually located in `/data/db/...`) the `ldap` authentication method. For example: