如何在Windows上安装gssapi python模块? [英] How to install gssapi python module on windows?

查看:625
本文介绍了如何在Windows上安装gssapi python模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试获取 gssapi模块,以便在python上运行视窗.我的目标是使用python模块 ldap3 向Active Directory进行身份验证. gssapi是这项工作的必要条件.但是,安装失败,因为找不到krb5-config.在Linux上,很容易安装.我安装了用于Windows的Kerberos ,但是它没有krb5-config而且在其他任何地方(Linux除外)都找不到它.有人知道在哪里可以找到所需的工具或如何继续(如果可能的话)?

I am currently trying to get the gssapi module for python to run on windows. My goal is to authenticate with an Active Directory using python module ldap3. gssapi is an requirement for this to work. However, installation fails because it cannot find krb5-config. On Linux it is easy to install. I installed Kerberos for Windows but it does not have krb5-config and I could not find it anywhere else (other than for Linux). Does anyone know where to find the required tools or how to continue (if it is possible at all)?

推荐答案

按照@keithhendry的建议(

Following the suggestion of @keithhendry (https://github.com/cannatag/ldap3/issues/190) I replaced the kerberos.py under ldap3\protocol\sasl\ with this one.

要使用Windows的GSSAPI,您还需要安装 winkerberos 软件包和 替换kerberos.py中第15行的kerberos导入,如下所示:

In order to use Windows' GSSAPI, you also need to install the winkerberos package and replace the kerberos import at line 15 in kerberos.py as follows:

import winkerberos as kerberos

这是透明的,因为winkerberos遵循与pykerberos相同的API结构,而kerberos.py就是基于pykerberos的.

This works transparently because winkerberos follows the same API structure as pykerberos, on which the edited kerberos.py was based.

现在,您可以在使用ldap3构造Connection时使用authentication=SASL, sasl_mechanism=GSSAPI,并且所有内容都应自动运行(假设Kerberos可能导致的其他999件事没有出错).

Now you can use authentication=SASL, sasl_mechanism=GSSAPI when constructing the Connection with ldap3 and everything should automagically work (assuming that the other 999 things that can go wrong with Kerberos don't go wrong).

这篇关于如何在Windows上安装gssapi python模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆