You can use UserGroupInformation to do this. The steps look like:
1. UserGroupInformation.setConfiguration(conf);

2. UserGroupInformation ugi =
UserGroupInformation.loginUserFromKeytabAndReturnUGI(principal, keytabPath);

3. ugi.doAs



2018-05-10 16:11 GMT+08:00 Lalit Jadhav <lalit.jad...@nciportal.com>:

> Deepak,
>
> You can refer,
> http://hbase.apache.org/0.94/book/hbase.accesscontrol.configuration.html
>
> On Thu, May 10, 2018 at 12:44 PM, Deepak Khandelwal <
> dkhandelwal....@gmail.com> wrote:
>
> > Hi, can someone help on below issue or point me to something that could
> > help.
> >
> > I have a table in hbase from which I am trying to read data based on row
> > key.
> > Now this data will be read from an API. I need to read data for 2
> different
> > users - user1 and user 2. User1 which has permission on table should be
> > able to read data wherein user 2 call can fail if he doesn't have
> > permission to read data on that table.
> >
> > Can someone tell how can I programmatically read data from hbase table
> for
> > 2 different user ids?
> >
> > Any help would be much appreciated.
> >
> > Thanks
> > Deepak
> >
>
>
>
> --
> Regards,
> Lalit Jadhav
> Network Component Private Limited.
>

Reply via email to