Kerberos auth Failed

Open
#376 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python

Research direction

Read pyhive/hive.py, starting with hive.Connection and the nested sasl_factory() shown in the issue. Trace how the connection arguments reach SASL, then verify that the serverFQDN value is accepted by hive.Connection and propagated to sasl_client.setAttr('host', serverFQDN) for Kerberos authentication.

Written by the indexing model from the issue text.

Description

from pyhive import hive

con = hive.Connection(host="10.8.8.8", port=21000, auth='KERBEROS', kerberos_service_name="hive")
cursor = con.cursor()
cursor.execute('show databases')
datas = cursor.fetchall()
print(datas)

thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-1) SASL(-1): generic failure: GSSAPI Failure: no serverFQDN'

Debug the code in "pyhive/hive.py"

                def sasl_factory():
                    sasl_client = sasl.Client()
                    #sasl_client.setAttr('host', serverFQDN)
                    if sasl_auth == 'GSSAPI':
                        sasl_client.setAttr('service', kerberos_service_name)

and find that serverFQDN should be taken as the input to hive.Connection and propagate to sasl_factory()

Dominant language
Python
Stars
1.7k
Forks
545
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dropbox/PyHive

All issues in dropbox/PyHive

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.