Using Password File Authentication
You can configure the connector to use the password file protocol to authenticate the connection.
You provide the configuration information to the connector in the connection URL. For more information about the syntax of the connection URL, see Building the Connection URL.
Note:
If Password File authentication is enabled, then SSL is automatically enabled. For more information, see Configuring SSL Connections.
Prerequisites
Before you can use Password File authentication with the Simba Presto JDBC Connector, you must do the following:
- On your Presto server, in the
/etc/presto/config.properties
file, set the following properties: - Replace the
password-authenticator.properties
file with a file containing the following: - Create a
password.db
file in/etc/presto/
. In the file, specify a user name and password separated by a colon (:
). To include multiple pairs of user names and passwords, put each pair on a separate line. Passwords must be encoded with the bcrypt format. Password files utilizing the bcrypt format can be created using the htpasswd utility from the Apache HTTP Server.
http-server.authentication.type=PASSWORD
http-server.https.enabled=true
http-server.https.port=8443
http-server.https.keystore.path=/var/lib/presto/security/cacert.jks
http-server.https.keystore.key=changeit
password-authenticator.name=file
file.password-file=/etc/presto/password.db
Using Password File Credentials in a Connection URL
- In the connection URL, set the
AuthenticationType
property toPassword File Authentication
. - Set the
SSLTrustStorePath
property to the full path of the TrustStore that you want to use. - Set the
SSLTrustStorePwd
property to your password for accessing the TrustStore. - Set the
UID
property to the user name from thepassword.db
stored in the Presto server. - Set the
PWD
property to the corresponding password from thepassword.db
stored in the Presto server.
For example:
jdbc:presto://presto-ldap.sentest.com:8443;AuthenticationType=Password File Authentication;Catalog=hive;Schema=sen;SSLTrustStorePath=D:\\PrestoCert\\cacert.jks;SSLTrustStorePwd=changeit;UID=test;PWD=presto