This is an automated email from the ASF dual-hosted git repository.
stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-queryserver.git
The following commit(s) were added to refs/heads/master by this push:
new fb48285 PHOENIX-6414 Explicit creation of auch mech for SPNEGO
fb48285 is described below
commit fb48285a69a5678c6c1648ebcbdcb685c3dbf32a
Author: Carlos Garcia Montoro <[email protected]>
AuthorDate: Fri Mar 26 13:17:01 2021 +0100
PHOENIX-6414 Explicit creation of auch mech for SPNEGO
---
python-phoenixdb/phoenixdb/__init__.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/python-phoenixdb/phoenixdb/__init__.py
b/python-phoenixdb/phoenixdb/__init__.py
index 14e5a8d..93f47eb 100644
--- a/python-phoenixdb/phoenixdb/__init__.py
+++ b/python-phoenixdb/phoenixdb/__init__.py
@@ -14,6 +14,8 @@
# limitations under the License.
import sys
+import gssapi
+
from phoenixdb import errors, types
from phoenixdb.avatica import AvaticaClient
from phoenixdb.connection import Connection
@@ -177,7 +179,11 @@ def _process_args(
auth = HTTPSPNEGOAuth(opportunistic_auth=True)
elif auth is None and authentication is not None:
if authentication == "SPNEGO":
- auth = HTTPSPNEGOAuth(opportunistic_auth=True)
+ try:
+ spnego = gssapi.mechs.Mechanism.from_sasl_name("SPNEGO")
+ except AttributeError:
+ spnego = gssapi.OID.from_int_seq("1.3.6.1.5.5.2")
+ auth = HTTPSPNEGOAuth(opportunistic_auth=True, mech=spnego)
elif authentication == "BASIC" and avatica_user is not None and
avatica_password is not None:
auth = HTTPBasicAuth(avatica_user, avatica_password)
elif authentication == "DIGEST" and avatica_user is not None and
avatica_password is not None: