Configuring Authentication

You can configure the following types of authentication:

  • No authentication
  • MapR-SASL
  • User name
  • User name and password
  • Kerberos

When hive.server2. authentication is set to KERBEROS, then you must configure your connection to use Kerberos.

To find out the authentication setting your Hive Server 2 is set to use, review the following properties in the hive-site.xml file:

  • hive.server2.authentication
  • hive.server2.enable.doAs

Using No Authentication

To use no authentication, set the AuthMech configuration key for the DSN to 0.

Using MapR-SASL

To configure MapR-SASL SASL in odbc.ini, set the following option:
AuthMech=13

Using User Name

To configure User Name authentication:

  1. Set the AuthMech configuration key for the DSN to 2.
  2. Set the UID key to the appropriate user name recognized by the Hive server.

Using User Name and Password

To configure User Name and Password authentication:

  1. Set the AuthMech configuration key for the DSN to 3.
  2. Set the UID key to the appropriate user name recognized by the Hive server.
  3. Set the PWD key to the password corresponding to the user name you provided in step 2.

Using Kerberos

To configure Kerberos authentication:
  1. Set the H2SAuthMech configuration key for the DSN to 1.
  2. If your Kerberos setup does not define a default realm or if the realm of your Hive server is not the default, then set the appropriate realm using the HS2KrbRealm key.
  3. Set the HS2HostFQDN key to the fully qualified domain name of the Hive Server 2 host.
  4. Set the HS2KrbServiceName key to the service name of the Hive Server 2 host.