O'Reilly logo

PostgreSQL 9 Administration Cookbook - Second Edition by Simon Riggs, Gianni Ciolli, Hannu Krosing, Gabriele Bartolini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating with LDAP

This recipe shows you how to set up your PostgreSQL system so that it uses the Lightweight Directory Access Protocol (LDAP) for authentication.

Getting ready

Ensure that the usernames in the database and your LDAP server match, as this method works for user authentication checks of users who are already defined in the database.

Unfortunately, as LDAP is used only to validate username/password pairs, this method cannot use the PostgreSQL User Name Map feature to allow a single LDAP user to connect as multiple database users.

How to do it…

In the PostgreSQL authentication file, pg_hba.conf, we define some address ranges to use LDAP as an authentication method, and we configure the LDAP server for this address range:

host all all ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required