How to forward credentials in the header the Knox Basic Auth

374 Views Asked by At

I'm trying to connect to a Hive database from the API WebHDFS which needs credentials to connect on. I'm in a big company and i have to use another gateway so i want to forward credentials of the big data platform in the header but i always have a 401 unauthaurized.

I tried a lot of parameters names but none of them are working

i expect to find the right name of parameters / variables that Knox understand.

1

There are 1 best solutions below

0
On

This question is unclear. I don't know what you mean by trying to connect to a Hive database from the API WebHDFS. WebHDFS can indeed expect HTTP basic auth when being protected by Apache Knox. However, you cannot connect to Hive through the WebHDFS API.

Typically, JDBC or ODBC is used to connect to Hive databases via HiveServer2. You can use beeline or another SQL tool with JDBC/ODBC support.

http://knox.apache.org/books/knox-1-3-0/user-guide.html#WebHDFS+via+cURL will show you how to use curl to provide username and password via HTTP Basic in order to access files in HDFS.

The following will show you the connect string and other details for accessing HiveServer2 through Apache Knox. Note that HS2 must be running in HTTP Mode in order to be proxied by Knox. http://knox.apache.org/books/knox-1-3-0/user-guide.html#Hive+JDBC+URL+Mapping