hive 认证
来源:互联网 发布:淘宝平均停留时间 编辑:程序博客网 时间:2024/05/22 05:38
Pluggable custom authentication: Pluggable custom authentication provides a custom authentication provider for HiveServer2. To enable it, confgure the
settings as follows:
<property>
<name>hive.server2.authentication</name>
<value>CUSTOM</value>
</property>
<property>
<name>hive.server2.custom.authentication.class</name>
<value>pluggable-auth-class-name</value>
<description> Custom authentication class name, such as
com.packtpub.hive.essentials.hiveudf.customAuthenticator
</description>
</property>
The following is a sample of a customized class that implements theorg.apache.hive.service.auth.PasswdAuthenticationProviderinterface.The overridde Authenticatemethod has the core logic of how to authenticate a username and password. Make sure to copy the compiled JAR fle to$HIVE_HOME/lib/ so that the preceding settings can work.
customAuthenticator.java
package com.packtpub.hive.essentials.hiveudf;
import java.util.Hashtable;
import javax.security.sasl.AuthenticationException;
import org.apache.hive.service.auth.PasswdAuthenticationProvider;
/*
* The customized class for HiveServer2 authentication
*/
public class customAuthenticator implements PasswdAuthenticationProvider {
Hashtable<String, String> authHashTable = null;
public customAuthenticator () {
authHashTable = new Hashtable<String, String>();
authHashTable.put("user1", "passwd1");
authHashTable.put("user2", "passwd2");
}
@Override
public void Authenticate(String user, String password) throws AuthenticationException {
String storedPasswd = authHashTable.get(user);
if (storedPasswd != null && storedPasswd.equals(password))
return;
throw new AuthenticationException("customAuthenticatorException: Invalid user");
}
}
settings as follows:
<property>
<name>hive.server2.authentication</name>
<value>CUSTOM</value>
</property>
<property>
<name>hive.server2.custom.authentication.class</name>
<value>pluggable-auth-class-name</value>
<description> Custom authentication class name, such as
com.packtpub.hive.essentials.hiveudf.customAuthenticator
</description>
</property>
The following is a sample of a customized class that implements theorg.apache.hive.service.auth.PasswdAuthenticationProviderinterface.The overridde Authenticatemethod has the core logic of how to authenticate a username and password. Make sure to copy the compiled JAR fle to$HIVE_HOME/lib/ so that the preceding settings can work.
customAuthenticator.java
package com.packtpub.hive.essentials.hiveudf;
import java.util.Hashtable;
import javax.security.sasl.AuthenticationException;
import org.apache.hive.service.auth.PasswdAuthenticationProvider;
/*
* The customized class for HiveServer2 authentication
*/
public class customAuthenticator implements PasswdAuthenticationProvider {
Hashtable<String, String> authHashTable = null;
public customAuthenticator () {
authHashTable = new Hashtable<String, String>();
authHashTable.put("user1", "passwd1");
authHashTable.put("user2", "passwd2");
}
@Override
public void Authenticate(String user, String password) throws AuthenticationException {
String storedPasswd = authHashTable.get(user);
if (storedPasswd != null && storedPasswd.equals(password))
return;
throw new AuthenticationException("customAuthenticatorException: Invalid user");
}
}
阅读全文
0 0
- hive 认证
- Hive配置Kerberos认证
- hive添加认证
- Hive配置Kerberos认证
- hive添加自定义认证类 CustomHiveServer2Auth.java
- (转载)详解Hive配置Kerberos认证
- Hive权限管理默认认证-传统模式
- 基于存储层面的hive metastore server的权限认证
- Kerberos认证下Sparksql向hive写数据错误
- 认证
- 认证
- 认证
- 认证
- hive0.11的hive server实现kerberos认证和impersonation中碰到的问题
- [一起学Hive]之二十-自定义HiveServer2的用户安全认证
- Hive
- HIVE
- Hive
- Servlet 单例吗?action单例吗?
- poi实现Excel模板的报表导出
- Oracle11g中---SqlPlus可以正常登陆,sqlDeveloper无法登录
- 锁的种类与特点
- 支付功能集成包-简单设计
- hive 认证
- 剑指offer--二进制中的1的个数--补码
- Android Studio导入Eclipse项目操作步骤 在选SDK时一定不要使用默认,要改成19,否则运行按键就是灰色
- HDOJ 3709 balanced number (digit dp)
- PHP源码安装后找不到配置文件的问题处理
- 获取HUD的方法
- poj dfs相关之1321 棋盘问题
- String,StringBuffer和StringBuilder的区别
- Android 解决apk覆盖安装的时候,出现安装失败,与旧版本部兼容的问题