Database Reference
In-Depth Information
Integrating with LDAP
This recipe shows how to set up your PostgreSQL system so that it uses LDAP (lightweight
Directory Access Protocol) for authentication.
Getting ready
Ensure that the usernames in database and your LDAP server match, as this method works
for user authentication checks for users already defined in the database.
How to do it...
In PostgreSQL's authentication file, pg_hba.conf , define some of address ranges to use
LDAP as an authentication method, and configure the LDAP server for this addess range.
host all all 10.10.0.1/16 ldap \
ldapserver=ldap.our.net ldapprefix="cn=" ldapsuffix=", dc=our,
dc=net"
How it works...
This setup makes postgresql server check passwords from the configured LDAP server.
User rights are not queried from LDAP server, but have to be defined inside the database,
using ALTER USER , GRANT , and REVOKE commands.
There's more...
Setting up the client to use LDAP
If you are using the pg_service.conf file for defining your database access parameters,
you may define some of those to be queried from LDAP server, by including line similar to the
following in your pg_service.conf ile:
ldap://ldap.mycompany.com/dc=mycompany,dc=com?uniqueMember?one?(cn=my
database)
See also
For server setup, visit the following website:
http://www.postgresql.org/docs/8.4/stat ic/auth-methods.html#AUTH-LDAP
For client setup, visit the following website:
http://www.postgresql.org/do cs/8.4/static/libpq-ldap.html
 
Search WWH ::




Custom Search