python-ntlm认证

本文介绍了一个Python库,该库提供了对NTLM的支持,包括为urllib2提供的身份验证处理程序。通过此库,可以使用Python的urllib2从受Windows身份验证保护的服务器检索内容。文章还提供了一个简单的使用示例以及更复杂的示例,展示了如何配置代理和不同的身份验证类型。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

python-ntlm

Python library that provides NTLM support, including an authentication handler for urllib2.

This library allows you to retrieve content from (usually corporate) servers protected with windows authentication (NTLM) using the python urllib2.

Python 3 Support

There is work going on to port the library to python 3, you can find it in the python30 directory. (at this time it seems to work as good as the python 2 library)

Usage

Simple example

 urllib2 
 ntlm   
 
user   
password   
url   
 
passman  urllib2 
passmanadd_password url user password 
 
auth_NTLM  passman 
 
 
opener  urllib2build_openerauth_NTLM 
urllib2install_openeropener 
 
 
response  urllib2urlopenurl 
responseread

Extended Example

 urllib2 
 urlparse  urlparse urlunparse 
 ntlm   
 
user   
password   
url   
 
parsed_url  urlparsehref 
base_uri  urlunparseparsed_urlparsed_url 
 
passman  urllib2 
passmanadd_password base_uri user password 
 
auth_NTLM  passman 
 
 
auth_basic  urllib2passman 
auth_digest  urllib2passman 
 
 
proxy_handler  urllib2 
 
 
opener  urllib2build_openerproxy_handler auth_NTLM auth_digest auth_basic 
urllib2install_openeropener 
 
 
response  urllib2urlopenurl 
responseread

Limitations

  • A request using the HTTPNtlmAuthHandler

转载于:https://www.cnblogs.com/yd1227/archive/2009/09/29/1576380.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值