Using a Hadoop Delegation Token

This authentication mechanism requires a Hadoop delegation token. This token must be provided to the connector in the form of a Base64 URL-safe encoded string. It can be obtained from the connector using the getDelegationToken() function, or by utilizing the Hadoop distribution .jar files. For a code sample that demonstrates how to retrieve the token using the getDelegationToken() function, see Code Samples: Retrieving a Hadoop Delegation Token.

You provide this information to the connector in the connection URL. For more information about the syntax of the connection URL, see Building the Connection URL.

Note:

  • This authentication mechanism is available only for Hive Server 2.
  • This authentication mechanism requires that Kerberos be configured on the server.

To configure Hadoop delegation token authentication:

  1. Make sure Kerberos is configured on the server.
  2. Set the AuthMech property to 6.
  3. Set the delegationToken property to an appropriately encoded Hadoop delegation token.

For example:

jdbc:hive2://node1.example.com:10000;AuthMech=6;delegationToken=kP9PcyQ7prK2LwUMZMpFQ4R+5VE