title: Connect HBase via Knox using HBase Java Client on CDP
body: <p>I need to connect to HBase via Knox using HBase Java Client. I have Knox details as following</p>
  <pre><code>Knox_Url: https://knox-host:port/gateway/cdp-proxy-api/hbase
  Username: knox_user_name
  Password: knox_password
  </code></pre>
  <p>With the below code, I am able to add the URL but not able to add the credentials.</p>
  <pre><code>URL url = new URL(Knox_Url);
  Configuration conf = HBaseConfiguration.create();
  conf.addResource(URL);
  
  Connection con = ConnectionFactory.createConnection(conf);
  </code></pre>
  <p>I have seen other StackOverflow questions, but all they have mentioned the below properties to set in the configuration.</p>
  <pre><code> public void setUp() throws IOException {
          config = HBaseConfiguration.create();
          config.set(&quot;zookeeper.znode.parent&quot;,&quot;/hbase-unsecure&quot;);
          config.set(&quot;hbase.zookeeper.quorum&quot;, ZOOKEEPER_QUORUM);
          config.set(&quot;hbase.zookeeper.property.clientPort&quot;, &quot;2181&quot;);
          config.set(&quot;hbase.cluster.distributed&quot;, &quot;true&quot;);
          connection = ConnectionFactory.createConnection(config);
      }
  </code></pre>
  <p>My question is there a way to use the Knox gateway details to connect to HBase and retrieve the data?</p>