pgjdbc / r2dbc-postgresql

Postgresql R2DBC Driver
https://r2dbc.io
Apache License 2.0
1.01k stars 177 forks source link

Add Kerberos authentication support #392

Open akiraly opened 3 years ago

akiraly commented 3 years ago

Feature Request

The traditional Postgres JDBC driver supports Kerberos authentication (kerberosServerName, jaasApplicationName,... connection properties). In tightly controlled environments it is enforced to use Kerberos, blocking developers from using the r2dbc driver instead of the jdbc one.

Is your feature request related to a problem? Please describe

Can't use r2db driver because it doesn't support kerberos authentication.

Describe the solution you'd like

To be able to use kerberos authentication - similarly to how it works with the postgres jdbc driver.

Describe alternatives you've considered

Maybe some kind of r2dbc to jdbc bridge (is that even possible?) so we can wrap the postgres jdbc into r2dbc and use it that way (together with Spring reactive transaction management).

Teachability, Documentation, Adoption, Migration Strategy

Need to document the new connection properties in the documentation.

mp911de commented 3 years ago

This looks like a duplicate of #315.

In any case, contributions are highly welcome.

frankgh commented 3 years ago

@mp911de I'd like to contribute this feature. Let me know if no one has picked it up already.

davecramer commented 3 years ago

So I muddled this up on the JDBC driver. I tried to emulate what libpq does when making the initial connection. They look for an existing key cache and then send the startup packet. Unfortunately java does not provide a native way to do this (easily) I would suggest using a connection parameter and if the user wants a kerberos encrypted connection then attempt it.

mp911de commented 2 years ago

@frankgh feel free to give it a spin. I'm totally unfamiliar with setting up a Kerberos environment, so any help is appreciated.