apple / ccs-pykerberos

Python Kerberos library used by CalendarServer
https://www.calendarserver.org
Apache License 2.0
117 stars 65 forks source link

Does pykerberos support both Windows and POSIX systems? #77

Closed rxu18 closed 5 years ago

rxu18 commented 5 years ago

Hi all,

Question as in title. I'm trying to develop Python code that can authenticate with both Window's Active Directory Kerberos and MIT Kerberos, and wonder if this is the appropriate package.

Thanks, Richard

dreness commented 5 years ago

Hi,

POSIX is definitely supported - in the sense that many POSIX-friendly operating systems are known to work (although probably not all of them). Windows is 'not really' supported - see https://github.com/apple/ccs-pykerberos/issues/42

I'm not sure how much work would be required to get ccs-pykerberos functional in Windows, although I'd guess most of that work would be in getting the C python modules to build cleanly. There might also be some path assumptions to fix, such as the location of the default keytab - the comments reference /etc/krb5.keytab, however I don't actually see any code-level definitions of that path so perhaps it just senses the current system-wide kerberos config, in which case the only wrong assumption is in the comment :)

behackett commented 5 years ago

Alternatively you can use https://pypi.org/project/winkerberos/, which provides the same API built on top of Microsoft's security framework. Projects usually follow this pattern to use either library, depending on the client operating system: https://github.com/requests/requests-kerberos/blob/01d6d39317da651ad67282b3e2b6489878e89fea/requests_kerberos/kerberos_.py#L1-L4

rxu18 commented 5 years ago

Thanks for the help! I will keep this open for a little longer since my implementation is still taking place, but your input has been amazing.