optional JAAS login - Mailing list pgsql-jdbc

From Kronus David
Subject optional JAAS login
Date
Msg-id dd0b4cd7d62e4430999d49a047b8a9b9@e08611e75587469181d56ec250a9eb09
Whole thread Raw
List pgsql-jdbc
Hi pgjdbc devs,
I made a little change in the driver for myself and I'd like to offer it for inclusion in the official distribution.

I was experimenting with the JAAS+GSS authentication provided by the driver and found out that I'd like to have the
possibilityto perform the JAAS login myself in the application that uses your pgjdbc driver. This means that I'd like
tohave the possibility of a full control of the creation of LoginContext. Currently the driver always creates this
object,the only configurable thing is the name of JAAS configuration to be used. However, problems include
specificationof JAAS login.conf file location (I know, there is this java system property but that's really not much
flexible)and the possibility to provide some functional implementation of the callback which might ask for a password
ifneeded (currently if there are no valid credentials in the ticketcache and there was no password provided initially
tothe driver, the authentication fails - it's much better to have the possibility to ask for the password only when
needed,I guess). 

On the hand I understand that for many uses it's handy to have the plugin actually perform the login so I decided to go
withparameter 'performJaasLogin' which is true by default and can be set to 'false' in the connection URL. Then it
determineswhether the login is performed by the driver (value 'true') or not. The code change is trivial and I've
testedit - it works as expected. You might use my ant task 'jaasauth' with the standard ant task 'sql' (specify empty
password)to perform the JAAS authentication if you want (look at http://dave.matfyz.cz/page/en/software.html for
downloadand documentation of 'jaasauth'). 

Of course if you think there is a need to modify the code change a bit let me know...

Greetings!
David

pgsql-jdbc by date:

Previous
From: Scott Harrington
Date:
Subject: Re: Separate threads for FE<=>BE writing/reading
Next
From: "Kronus David"
Date:
Subject: FW: optional JAAS login - attachment