Re: psycopg2 and java gssapi questions - Mailing list pgsql-hackers

From Mike Feld
Subject Re: psycopg2 and java gssapi questions
Date
Msg-id 16098921fbd-1719-e1b@webjas-vab044.srv.aolmail.net
Whole thread Raw
List pgsql-hackers
What about when the ticket expires? Are there any libraries that manage this for the application? Is this common practice by anyone?

Mike


-----Original Message-----
From: Dave Cramer <pg@fastcrypt.com>
To: Magnus Hagander <magnus@hagander.net>
Cc: Mike Feld <m1f7@aol.com>; pgsql-general <pgsql-general@lists.postgresql.org>
Sent: Thu, Dec 21, 2017 6:09 am
Subject: Re: psycopg2 and java gssapi questions

On 21 December 2017 at 05:27, Magnus Hagander <magnus@hagander.net> wrote:


On Wed, Dec 20, 2017 at 8:42 PM, Mike Feld <m1f7@aol.com> wrote:
Is it possible to authenticate with Postgres from a standalone application using gssapi? In other words, I am able to authenticate with Postgres when a human has logged in to either Windows or Linux and generated a ticket, but is it possible for say a Django site or Java application running on some server somewhere to authenticate with Postgres using gssapi? I realize that psycopg2 has a connection parameter for “krbsrvname”, but how does it generate a ticket? Is this the only alternative to secure authentication since Postgres does not support secure ldap (ldaps)?

Sure it is. 

libpq won't generate the initial ticket, though. The way to do it is to have your django or whatever application run "kinit" for the user before it starts. This will request a TGT, and the ticket will be present in that users environment, and will be used by the libpq client. (it might look slightly different for a Java client, but the principle is the same)





pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Re: AS OF queries
Next
From: Teodor Sigaev
Date:
Subject: pgsql: Update relation's stats in pg_class during vacuum full.