I've got a database where access is controlled not with a password but with kerberos. Are there any examples of connecting to a database like this with clojure?
@bill.h.tucker_slack Look up how to access it via JDBC. You should be able to apply that to Clojure.
Sorry @bill.h.tucker_slack I just meant, if you know the properties used for JDBC, just pass them in a hash map for Clojure:
props.setProperty(
OracleConnection.CONNECTION_PROPERTY_THIN_NET_AUTHENTICATION_SERVICES,
"( " + AnoServices.AUTHENTICATION_KERBEROS5 + " )");
props.setProperty(
OracleConnection.CONNECTION_PROPERTY_THIN_NET_AUTHENTICATION_KRB5_MUTUAL,
"true");
That's the relevant bit so it is looking for
{:dbtype "oracle",
:dbname "yourdb",
OracleConnection/CONNECTION_PROPERTY_THIN_NET_AUTHENTICATION_SERVICES (str "(" AnoServices/AUTHENTICATION_KERBEROS5 ")"),
OracleConnection/CONNECTION_PROPERTY_THIN_NET_AUTHENTICATION_KRB5_MUTUAL "true"}
and you also need to invoke
(System/setProperty "java.security.krb5.conf" "path/to/your/krb5.conf")
before you call next.jdbc/get-datasource
on that db-spec hash map.Something like that should work.