Repoze.who.plugins.digeseth

repoze.who.plugins.digestauth的Python项目详细描述


这是repoze.who插件实现http摘要访问身份验证 根据RFC-2617:

http://tools.ietf.org/html/rfc2617

它为协议提供了良好的支持,因为它通常用于 野生:

  • both qop=”auth” and qop=”auth-int” modes
  • compatability mode for legacy clients
  • client nonce-count checking
  • next-nonce generation via the Authentication-Info header

http客户端很少支持该协议的以下特性 因此尚未实施:

  • MD5-sess, or any hash algorithm other than MD5
  • mutual authentication via the Authentication-Info header

配置

摘要身份验证插件的配置可以从标准 repoze.who配置文件如下:

[plugin:digestauth]
use = repoze.who.plugins.digestauth:make_plugin
realm = MyRealm
get_pwdhash = mymodule:get_pwdhash

以下配置选项可用:

  • realm: the realm string; included verbatim in the challenge header
  • domain: the domain string; included verbatim in the challenge header
  • qop: the desired quality of protection (“auth” or “auth-int”)
  • get_password: dotted name of a callback to get the user’s password
  • get_pwdhash: dotted name of a callback to get the user’s password hash
  • nonce_manager: dotted name of a class to use for nonce management

身份验证

要通过摘要身份验证对用户进行身份验证,此插件需要访问 它们的原始密码或“密码散列”,这是它们的MD5摘要 用户名、密码和身份验证领域:

def calculate_pwdhash(username, password, realm):
    return md5("%s:%s:%s" % (username, realm, password)).hexdigest()

必须提供回调函数“get_password”或“get_pwdhash”以 DigestAuthPlugin。

临时管理

摘要访问认证的安全性在很大程度上取决于 密码nonce的产生与管理。为了防止重播 攻击服务器必须拒绝具有重复nonce的请求。

nonce管理的细节被提取到一个单独的接口中, 由repoze.who.plugins.digestauth.nonmanager定义:nonmanager类。 默认实现使用hmac签名令牌和 最近看到的Nonce很重要。如果你有更特殊的需要 实现自己的非管理器子类

0.1.1-2012年1月30日

  • 将许可证更新为MPL 2.0。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在JUnit5中定义优先级   Web驱动程序将焦点切换到iframe的java困难   java JFileChooser没有文件名文本字段选项   本地化是否可以回退到Java中resourcebundle的宏语言(例如,nynorsk>norsk)   禁用时Java断言的性能拖动   未考虑执行中的java jsonschema2pojo maven插件配置   java微调器。setSelection未调用setOnItemSelectedListener函数   序列化XStream:序列化java的反序列化。sql。时间导致错误   java无法理解为什么“ajpnio8009execXX”线程在AbstractQueuedSynchronizer$ConditionObject上阻塞/等待时间。等候   Java date给我的格式是mm/dd/yyyy,其中jquery datepicker的日期格式是dd/mm/yyyy   jsf如何用javaweb应用程序在客户端重写csv文件   雅加达ee Java邮件Api,无法从outlook客户端读取“.msg附件”   java PreparedStatement性能调优