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:

  1. On your Presto server, in the /etc/presto/config.properties file, set the following properties:
  2. 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

  3. Replace the password-authenticator.properties file with a file containing the following:
  4. password-authenticator.name=file

    file.password-file=/etc/presto/password.db

  5. 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.

Using Password File Credentials in a Connection URL

  1. In the connection URL, set the AuthenticationType property to Password File Authentication.
  2. Set the SSLTrustStorePath property to the full path of the TrustStore that you want to use.
  3. Set the SSLTrustStorePwd property to your password for accessing the TrustStore.
  4. Set the UID property to the user name from the password.db stored in the Presto server.
  5. Set the PWD property to the corresponding password from the password.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