Skip to content

Commit e2ef986

Browse files
committed
Compatibility with the pykerberos package.
There are two Kerberos bindings on PyPI: kerberos and pykerberos. PyMongo has been compatible with the kerberos package since PyMongo 2.5.0. But kerberos is not currently compatible with Python 3. This change introduces compatibility with the new pykerberos package. Since pykerberos is compatible with Python 3, PyMongo can now use Kerberos in Python 3.
1 parent 3a4d894 commit e2ef986

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pymongo/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def _authenticate_gssapi(credentials, sock_info, cmd_func):
8787
dummy, username, gsn = credentials
8888
# Starting here and continuing through the while loop below - establish
8989
# the security context. See RFC 4752, Section 3.1, first paragraph.
90-
result, ctx = kerberos.authGSSClientInit(gsn + '@' + sock_info.host,
91-
kerberos.GSS_C_MUTUAL_FLAG)
90+
result, ctx = kerberos.authGSSClientInit(
91+
gsn + '@' + sock_info.host, gssflags=kerberos.GSS_C_MUTUAL_FLAG)
92+
9293
if result != kerberos.AUTH_GSS_COMPLETE:
9394
raise OperationFailure('Kerberos context failed to initialize.')
9495

0 commit comments

Comments
 (0)