0

I have gone through a wide search but nothing is working for me. Code goes something like this:

from impala.dbapi import connect
conn = connect(host = 'myhost', port = 21050, auth_mechanism = 'GSSAPI', kerberos_service_name = 'impala')

cursor = conn.cursor()

TTransportException: TTransportException(type=1, message="Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2'")

Have tried many different versions of the following, but currently here are any possible relevant libraries:

Python 3.6.9

impyla 0.14.0

pure-sasl 0.6.2

pysasl 0.5.0

sasl 0.2.1

thrift 0.13.0

thrift-sasl 0.3.0

thriftpy 0.3.9

thriftpy2 0.4.8

Any help would be greatly appreciated.

formicaman
  • 1,317
  • 3
  • 16
  • 32

1 Answers1

0

I have tried multiple libraries on python and failed when trying to authenticate from a windows machine.There is no easy way. The Kerberos libraries mainly work on Linux. The workarounds for Windows do not work. So what can be the solution to this. Well... be a Roman while in Rome. Try the windows native libraries from Python.

import sys
import clr
from System.Net.Http import *
myClienthandler = HttpClientHandler()
myClienthandler.UseDefaultCredentials = True
myClient = HttpClient(myClienthandler)
x = myClient.GetStringAsync("putyourURLwithinthequoteshere")
myresult = x.Result
print(myresult)

Note that the this python script will have to run by the user who has access to the URL you are trying to access. By setting UseDefaultCredentials property as True you are passing the Kerberos tickets for the logged in user.

ambassallo
  • 924
  • 1
  • 12
  • 27