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编辑并重新运行spring引导单元测试,无需重新加载上下文即可加快测试速度   为什么我不能做演员?   java为什么是线程。join通常用于停止安卓中的线程   java从weblogic服务器调用JSON POST REST服务时收到400:错误请求   java在DeviceAdmin模式禁用时设置身份验证?   java SortedMap的keySet()能否始终安全地强制转换到SortedSet?   安卓 java。lang.NoSuchMethodException可包裹类   java JOGL库安装   javatomcat内存管理   java使用getString()中的变量   java将最小星号设置为评级栏   Java中字符串相等的println()方法。。。它到底是如何工作的?   java如何从文本中输出的数组中放入随机图像