【问题标题】:pyramid AuthTktAuthenticationPolicy with other frameworks金字塔 AuthTktAuthenticationPolicy 与其他框架
【发布时间】:2013-03-09 21:05:29
【问题描述】:

我需要使用来自金字塔的 AuthTktAuthenticationPolicy 向 Twisted 服务器授权的身份验证 cookie,以便我可以有效地进行长轮询。有没有办法让 Twisted 服务器从金字塔中解码身份验证 cookie?

【问题讨论】:

    标签: python authentication twisted comet pyramid


    【解决方案1】:

    AuthTktAuthenticationPolicy 代码遵循mod_tkt_auth Apache 模块的标准集。如果您实现相同的算法并在您的 Twisted 服务器上配置它以使用与您的 Pyramid 服务器相同的秘密,您可以解码该 cookie,是的。

    事实上,Pyramid 重新使用了 Paste 项目中的 tkt_auth 代码来完成此任务,并在非常宽松的 MIT 许可下获得许可。您也可以将它重用于您的 Twisted 应用程序;在the Paste bitbucket repository 找到它。

    parse_ticket() 函数只需要服务器端密码、cookie 值、远程连接的 ip 地址和可选的哈希算法(默认为 MD5)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-22
      • 2015-03-23
      • 1970-01-01
      • 2014-02-10
      • 1970-01-01
      • 1970-01-01
      • 2013-05-22
      • 2013-02-26
      相关资源
      最近更新 更多