1.在hive-site.xml中加
<property>
<name>hive.server2.authentication</name>
<value>CUSTOM</value>
</property>
<property>
<name>hive.server2.custom.authentication.class</name>
<value>org.apache.hadoop.hive.contrib.auth.XXXXPasswdAuthenticator</value>
</property>
设置server2验证方式是CUSTOM ;并指定自定义验证类是org.apache.hadoop.hive.contrib.auth.XXXXPasswdAuthenticator
2.完成自定义验证类org.apache.hadoop.hive.contrib.auth.XXXXPasswdAuthenticator,继承org.apache.hive.service.auth.PasswdAuthenticationProvider
重写方法,如下:
@Override
public void Authenticate(String userName, String passwd)
throws AuthenticationException {
LOG.info("user: "+