-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing pywin32's sspi with winkerberos leads to exception #19
Comments
WinKerberos is not a re-implementation of pywin32's SSPI interface. All it does is re-implement PyKerberos on SSPI. It is designed to do Kerberos auth, not NTLM. That said, you can pass mech_oid=winkerberos.GSS_MECH_OID_SPNEGO to authGSSClientInit. That initializes the credentials for "Negotiate" mode, presumably for client / server setups that will negotiate to use Kerberos. |
This definitely is not correct:
The first parameter is a GSSAPI service principal, |
Thanks to your earlier comment, I got this working. status, self.ctx = winkerberos.authGSSClientInit("NTLM", gssflags=0,
mech_oid=winkerberos.GSS_MECH_OID_SPNEGO) Setting service = "NTLM" works fine since I'm authenticating locally. I've posted my changes (see class NtlmMessageGenerator) which can be used as a reference for using pywin32 SSPI and winkerberos interchangeably for local NTLM auth without a password. Thanks a bunch for your quick reply and the great work with winkerberos. |
Neat. I'm glad this project is useful for you. |
Hello @behackett, considering I have I've been requested to add Kerberos support to Px but I believe it should work as is. Unfortunately I have no way to check since I don't have a setup to verify against. Any advise is greatly appreciated, thanks in advance. |
That is how it should work AFAICT. GSS_MECH_OID_SPENGO was added to match PyKerberos. I've tested it against a krb5 KDC successfully, but I don't have an NTLM environment to test it with, and WinKerberos wasn't created for NTLM. |
Thanks for getting back, ya I hope the issue submitter will try out Px in his setup and it just works. |
This may not really be an issue but found no other way to communicate. I'm trying to replace pywin32's SSPI implementation within Px with winkerberos due to this issue.
I have the following code:-
However, it fails as follows:-
Is NTLM not a valid service endpoint? It works fine with pywin32 (except for that issue with Python 3.6+). I'm running this on Windows 10.
Thanks in advance.
The text was updated successfully, but these errors were encountered: