我在 apache knox 中设置了基于令牌的身份验证。我可以使用以下命令生成令牌:
curl -ivku guest:guest-password https://localhost:8443/gateway/sandbox/knoxtoken/api/v1/token
使用令牌,我在 curl 命令中进行身份验证,如下所示:
curl -ivk -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJndWVzdCIsImF1ZCI6InRva2VuYmFzZWQiLCJpc3MiOiJLTk9YU1NPIiwiZXhwIjoxNDg5OTQyMTg4fQ.bcqSK7zMnABEM_HVsm3oWNDrQ_ei7PcMI4AtZEERY9LaPo9dzugOg3PA5JH2BRF-lXM3tuEYuZPaZVf8PenzjtBbuQsCg9VVImuu2r1YNVJlcTQ7OV-eW50L6OTI0uZfyrFwX6C7jVhf7d7YR1NNxs4eVbXpS1TZ5fDIRSfU3MU" https://localhost:8443/gateway/tokenbased/webhdfs/v1/tmp?op=LISTSTATUS
但我想验证一个 hive jdbc 连接。如何在 hive jdbc url 中添加此令牌。我的 jdbc 网址是:
jdbc:hive2://localhost:8443/;ssl=true;sslTrustStore={path to gateway.jks};trustStorePassword={master-secret key};transportMode=http;httpPath=gateway/{cluster-name}/hive