If you don't want to deal with LDAP, I know of one other way:

<property>

    <name>hive.server2.authentication</name>

    <value>CUSTOM</value>

  </property>

  <property>

    <name>hive.server2.custom.authentication.class</name>

    <value>xxxx</value>

  </property>

You can implement: PasswdAuthenticationProvider and you put your
implementation class in (xxx). I think these guy have some examples:

from http://shiro.apache.org/
<http://shiro.apache.org/download.html#latestBinary>

But I haven't looked into it myself.






On Fri, Nov 28, 2014 at 5:05 AM, prasad bezavada <prasadbezav...@gmail.com>
wrote:

> Hi ,
>
>
>          I am writing a java program to connect with hive and query the
> data from hive. From  my program i am connecting  to hive as follows
>  private static String driverName =
> "org.apache.hadoop.hive.jdbc.HiveDriver";
> public static void main(String[] args) throws SQLException {
>     try {
>       Class.forName(driverName);
>     } catch (ClassNotFoundException e) {
>       // TODO Auto-generated catch block
>       e.printStackTrace();
>       System.exit(1);
>     }
>     Connection con = DriverManager.getConnection(
> "jdbc:hive://localhost:10000/default", "hive", "any");
>     Statement stmt = con.createStatement();
>     ....
>     My Problem is, the above connection is not taking the password ,i mean
> with any username and password it is allowing me to connect and ge
>     get the data from hive. But I want to  restrict this and want to
> provide security so that
>     only the  specified user would be able to connect and query hive.
>     I tried :pluggable authentication and its working fine.
>     But i want to do it dynamically.
>  i don't want to use LDAP or Kerberos.
>
> is there any way to do that?
>
> and can we create users and roles in hive
> ?if possible then how?
> when i use the command create role role_name its giving error i.e
> something like hive authorization incomplete or disabled
>
>
>
>
>

Reply via email to