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第三方库


热门话题
socketJava加密聊天客户端未通过关联   java保存JFileChooser的状态   java如何让代码等待GUI完成?   java可序列化和接口:Parcelable在写入可序列化对象时遇到IOException   java Jersey客户端将覆盖ROBOTS响应   java空指针异常&如何克服   java如何使用JAXR设置字符集?   JavaSpring自定义转换器被覆盖   java将泛型类型的值设置为DTO字段   使用netty的java音频流服务器   java滚动条添加到面板时不显示在滚动窗格中   java windows通过IIS Url重写单点登录tomcat   Web应用程序的java容器管理安全性   java使用mybatis将POJO项数组传递到存储过程?