From: Mike Feld <m1f7@aol.com>
To: pg@fastcrypt.com
To: magnus@hagander.net
Cc: pgsql-general@lists.postgresql.org
Subject: Re: psycopg2 and java gssapi questions
Date: Wed, 27 Dec 2017 10:23:21 -0500
Message-ID: <16098921fbd-1719-e1b@webjas-vab044.srv.aolmail.net> (raw)
In-Reply-To: <CADK3HHLX17M9Wht+0a-qAU4XdarAkE3gazDgr=k-jVpHXMgn8g@mail.gmail.com>
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 astandalone application using gssapi? In other words, I am able to authenticatewith Postgres when a human has logged in to either Windows or Linux andgenerated a ticket, but is it possible for say a Django site or Javaapplication running on some server somewhere to authenticate with Postgresusing 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)
JDBC docs on GSSAPI can be found https://jdbc.postgresql.org/documentation/head/connect.html
Dave Cramer
davec@postgresintl.com
www.postgresintl.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: m1f7@aol.com, pg@fastcrypt.com, magnus@hagander.net
Subject: Re: psycopg2 and java gssapi questions
In-Reply-To: <16098921fbd-1719-e1b@webjas-vab044.srv.aolmail.net>
References: <CADK3HHLX17M9Wht+0a-qAU4XdarAkE3gazDgr=k-jVpHXMgn8g@mail.gmail.com> <16098921fbd-1719-e1b@webjas-vab044.srv.aolmail.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox