X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 5309BD1B525 for ; Sun, 9 Nov 2003 15:53:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 01474-06 for ; Sun, 9 Nov 2003 11:52:53 -0400 (AST) Received: from arktis.luxadmin.org (arktis.luxadmin.org [195.206.105.1]) by svr1.postgresql.org (Postfix) with ESMTP id 46B59D1B4E6 for ; Sun, 9 Nov 2003 11:52:49 -0400 (AST) Received: from samara.atlantis.local (unknown [195.218.21.232]) by arktis.luxadmin.org (Postfix) with SMTP id 3624816062B for ; Sun, 9 Nov 2003 16:52:53 +0100 (CET) Date: Sun, 9 Nov 2003 16:52:28 +0100 From: Daniel Struck To: pgsql-php@postgresql.org Subject: client authentication towards postgresql in php? Message-Id: <20031109165228.45503144.struck.d@retrovirology.lu> X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/23 X-Sequence-Number: 2416 Hello, I am searching for a secure way to handle client authentication in php towa= rds postgresql. Let me explain what I like to setup: Client will connect to the application via Apache. The authentication of the clients will be done over ssl and the certificate= s of the clients will be stored on smartcards. (I have written a small documentation how to setup this at www.opensc.org). Next I will read in the PHP application environment variables of apache to = know if the user was correctly authenticated by apache. In postgresql I would like to create for every client a user. Purpose: automatically log every action like update/delete of users by rule= s without requiring scripts in php. The problem I have is to authenticate the client to postgresql. Of course I could save the passwords for the clients in a text file accessi= ble by the php application, but I don't like the idea of this file lying ar= ound on the hard drive. I thought about using Kerberos in this setup, sort of: 1.apache authenticates the client (two way ssl with smartcards) 2. client receives a ticket from kerberos 3. which php could forward to postgresql. Is this possible? Maybe someone knows another secure way of authenticating users to postgresq= l in a web application? Best regards, Daniel Struck --=20 Retrovirology Laboratory Luxembourg Centre Hospitalier de Luxembourg 4, rue E. Barbl=E9 L-1210 Luxembourg phone: +352-44116105 fax: +352-44116113 web: http://www.retrovirology.lu e-mail: struck.d@retrovirology.lu