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.propertiesfile, set the following properties: - Replace the
password-authenticator.propertiesfile with a file containing the following: - Create a
password.dbfile 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
AuthenticationTypeproperty toPassword File Authentication. - Set the
SSLTrustStorePathproperty to the full path of the TrustStore that you want to use. - Set the
SSLTrustStorePwdproperty to your password for accessing the TrustStore. - Set the
UIDproperty to the user name from thepassword.dbstored in the Presto server. - Set the
PWDproperty to the corresponding password from thepassword.dbstored 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