Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 6BA9F1337B51 for ; Wed, 3 Nov 2010 11:45:09 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 43247-01 for ; Wed, 3 Nov 2010 14:45:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from bay0-omc3-s4.bay0.hotmail.com (bay0-omc3-s4.bay0.hotmail.com [65.54.190.142]) by mail.postgresql.org (Postfix) with ESMTP id EA5521337B43 for ; Wed, 3 Nov 2010 11:44:59 -0300 (ADT) Received: from BAY149-W13 ([65.54.190.189]) by bay0-omc3-s4.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 3 Nov 2010 07:44:59 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_0aa07976-473b-416b-a033-f1bba68cfd98_" X-Originating-IP: [91.206.0.43] From: Kieren Scott To: , Subject: Re: Using LDAP with postgresql 8.2 Date: Wed, 3 Nov 2010 14:44:59 +0000 Importance: Normal In-Reply-To: <4CCA57A4.4010700@kzsdabas.hu> References: , <4CCA57A4.4010700@kzsdabas.hu> MIME-Version: 1.0 X-OriginalArrivalTime: 03 Nov 2010 14:44:59.0573 (UTC) FILETIME=[B0A55650:01CB7B65] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/13 X-Sequence-Number: 35979 --_0aa07976-473b-416b-a033-f1bba68cfd98_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi=2C I have made some progress on this=2C in that I've managed to get LDAP authe= ntication working=2C but not quite as I expected. I found out that the Canonical Name in AD was set to "PG Test" for the acco= unt name "pgtest". If I add "PG Test" as the user in pg_hba.conf and create a login "PG Test" = (matching case) and then try to login using LDAP authentication as follows:= - psql -h hostname -p 5432 -d dbname -U "PG Test" This works and allows me to login to the database! So Postgresql is matching the Username from psql client to the CN (canonica= l name) in Active Directory. The problem now is that we need to match the username to the Account name i= n AD=2C we can't change the CN's in AD just to match what Postgresql needs= =2C because so many other applications authenticate against AD... Is there any way of mapping CN's to Postgresql username's?? Has anybody els= e encountered this same problem and have you managed to get round it? Regards. Date: Fri=2C 29 Oct 2010 07:12:04 +0200 From: geza@kzsdabas.hu To: pgsql-admin@postgresql.org Subject: Re: [ADMIN] Using LDAP with postgresql 8.2 =20 Message body Hi=2C I'm not an AD expert myself=2C but I've read somewhere=2C that AD disallows simple binds without using ssl. You could try enabling ssl on AD=2C or try the krb5 authentication method for pg. Good Luck Geza I've setup LDAP on Postgresql 8.3.6 by adding the following line to pg_hba.conf. My Active Directory has a group called 'users group' which contains an entry for user pgtest. =20 host all pgtest xx.xxx.x.x/xx ldap "ldap://server.mydomain.com:389/basedn=3Bcn=3D=3B=2Cou=3Dusers group=2Cdc=3Dmydomain=2Cdc=3Dcom" =20 I have restarted the PG server but when I try to connect via psql from another host=2C I get the following error: - =20 2010-10-28 16:30:36 BST [1095]: [2-1] FATAL: LDAP authentication failed for user "pgtest" 2010-10-28 16:30:36 BST [1096]: [1-1] LOG: LDAP login failed for user "cn=3Dpgtest=2Cou=3Dusers group=2Cdc=3Dmydomain=2Cdc=3Dcom" on server "server.mydomain.com": error code 49 =20 So it looks like the cn=2C ou and dc parameters are correct=2C but for some reason Openldap is returning error 49=2C which is a generic authentication failure message. =20 Can anyone suggest anything that I might be doing wrong? Could it be the line in pg_hba.conf that is wrong=2C or possibly the ldap package on the server (debian linux) not working properly? =20 Any ideas much appreciated! =20 =20 From: kierenscott@hotmail.com To: pgsql-admin@postgresql.org Subject: Using LDAP with postgresql 8.2 Date: Wed=2C 27 Oct 2010 17:57:32 +0000 =20 =20 =20 =20 Hi=2C =20 I'm looking to implement LDAP authentication againt Active Directory for my=20 Postgresql databases. What's people experiences of using LDAP for authenticating logins with AD? Is it easy to setup and is there anything to watch out for e.g. does Postgresql do anything=20 intrusive on Active Directory (create anything) or does it just simply bind to AD=2C validate the=20 username/password pair and return success/failure back to the client? =20 Many thanks! = --_0aa07976-473b-416b-a033-f1bba68cfd98_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi=2C

I have made some progress on this=2C in that I've managed to g= et LDAP authentication working=2C but not quite as I expected.

I fou= nd out that the Canonical Name in AD was set to "PG Test" for the account n= ame "pgtest".

If I add "PG Test" as the user in pg_hba.conf and crea= te a login "PG Test" (matching case) and then try to login using LDAP authe= ntication as follows: -

psql -h hostname -p 5432 -d dbname -U "PG Te= st"

This works and allows me to login to the database!

So Pos= tgresql is matching the Username from psql client to the CN (canonical name= ) in Active Directory.

The problem now is that we need to match the = username to the Account name in AD=2C we can't change the CN's in AD just t= o match what Postgresql needs=2C because so many other applications authent= icate against AD...

Is there any way of mapping CN's to Postgresql u= sername's?? Has anybody else encountered this same problem and have you man= aged to get round it?

Regards.


Date: = Fri=2C 29 Oct 2010 07:12:04 +0200
From: geza@kzsdabas.hu
To: pgsql-ad= min@postgresql.org
Subject: Re: [ADMIN] Using LDAP with postgresql 8.2
=20 Message body Hi=2C
I'm not an AD expert myself=2C but I've read somewhere=2C that AD disallows simple binds without using ssl.
You could try enabling ssl on AD=2C or try the krb5 authentication method for pg.

Good Luck

Geza

I've setup LDAP on Postgresql 8.3.6 by adding the following line to pg_hba.conf. My Active Directory has a group called 'users group' which contains an entry for user pgtest.

host =3B =3B all =3B =3B pgtest =3B =3B =3B xx.= xxx.x.x/xx  =3B =3B =3B =3B ldap "ldap://server.mydo= main.com:389/basedn=3Bcn=3D=3B=2Cou=3Dusers group=2Cdc=3Dmydomain=2Cdc=3Dcom"

I have restarted the PG server but when I try to connect via psql from another host=2C I get the following error: -

2010-10-28 16:30:36 BST [1095]: [2-1] FATAL: =3B LDAP authentication failed for user "pgtest"
2010-10-28 16:30:36 BST [1096]: [1-1] LOG: =3B LDAP login failed for us= er "cn=3Dpgtest=2Cou=3Dusers group=2Cdc=3Dmydomain=2Cdc=3Dcom" on server "server.mydomain.com": error code 49

So it looks like the cn=2C ou and dc parameters are correct=2C but for some reason Openldap is returning error 49=2C which is a generic authentication failure message.

Can anyone suggest anything that I might be doing wrong? Could it be the line in pg_hba.conf that is wrong=2C or possibly the ldap package on the server (debian linux) not working
 =3Bproperly?

Any ideas much appreciated!



From: kierenscott@hotmail.com
To: pgsql-admin@postgresql.org
Subject: Using LDAP with postgresql 8.2
Date: Wed=2C 27 Oct 2010 17:57:32 +0000

=20 =20 Hi=2C

I'm looking to implement LDAP authentication againt Active Directory for my
Postgresql databases. What's people experiences of using LDAP for authenticating logins with AD?
Is it easy to setup and is there anything to watch out for e.g. does Postgresql do anything
intrusive on Active Directory (create anything) or does it just simply bind to AD=2C validate the
username/password pair and return success/failure back to the client?

Many thanks!

= --_0aa07976-473b-416b-a033-f1bba68cfd98_--