简体   繁体   English

Pylons + AuthKit中的用户身份验证

[英]User Authentication in Pylons + AuthKit

I am trying to create a web application using Pylons and the resources on the web point to the PylonsBook page which isn't of much help. 我正在尝试使用Pylons创建一个Web应用程序,并且Web上的资源指向PylonsBook页面,这对我们没什么帮助。 I want authentication and authorisation and is there anyway to setup Authkit to work easily with Pylons? 我想要身份验证和授权,无论如何都要设置Authkit以便与Pylons轻松合作?

I tried downloading the SimpleSiteTemplate from the cheeseshop but wasn't able to run the setup-app command. 我试图下载SimpleSiteTemplate从Cheeseshop上,但无法运行setup-app命令。 It throws up an error: 它引发了一个错误:

  File "/home/cnu/env/lib/python2.5/site-packages/SQLAlchemy-0.4.7-py2.5.egg/sqlalchemy/schema.py", line 96, in __call__
    table = metadata.tables[key]
AttributeError: 'module' object has no attribute 'tables'

I use Pylons 0.9.7rc1, SQLAlchemy 0.4.7, Authkit 0.4. 我使用Pylons 0.9.7rc1,SQLAlchemy 0.4.7,Authkit 0.4。

Ok, another update on the subject. 好的,关于这个问题的另一个更新。 It seems that the cheeseshop template is broken. 似乎cheeseshop模板被打破了。 I've followed the chapter you linked in the post and it seems that authkit is working fine. 我已经按照您在帖子中链接的章节进行了操作,似乎authkit工作正常。 There are some caveats: 有一些警告:

  1. sqlalchemy has to be in 0.5 version sqlalchemy必须是0.5版本
  2. authkit has to be the dev version from svn (easy_install authkit==dev) authkit必须是svn的开发版本(easy_install authkit == dev)

I managed to get it working fine. 我设法让它工作正常。

我放弃了authkit并推出了自己的: http ://tonylandis.com/openid-db-authentication-in-pylons-is-easy-with-rpx/

I don't think AuthKit is actively maintained anymore. 我不认为AuthKit会被积极维护。 It does use the Paste ( http://pythonpaste.org ) libs though for things like HTTP Basic/Digest authentication. 它确实使用了粘贴( http://pythonpaste.org )库,例如HTTP Basic / Digest身份验证。 I would probably go ahead and take a look at the source for some inspiration and then use the Paste tools if you want to use HTTP authentication. 我可能会继续看看源代码获取一些灵感,然后使用粘贴工具,如果你想使用HTTP身份验证。

There is also OpenID which is very easy to setup. 还有OpenID,很容易设置。 The python-openid libs have an excellent example that is easy to translate to WSGI for wrapping a Pylons app. python-openid libs有一个很好的例子,很容易转换为WSGI来包装Pylons应用程序。 You can look at an example: 你可以看一个例子:

http://ionrock.org/hg/brightcontent-main/file/d87b7dcc606c/brightcontent/plugins/openidauth.py http://ionrock.org/hg/brightcontent-main/file/d87b7dcc606c/brightcontent/plugins/openidauth.py

This actually got me interested: Check out this mailing on the pylons list . 这实际上让我感兴趣: 在挂架列表上查看此邮件 So AuthKit is being developed, and I will follow the book and get back on the results. 所以AuthKit正在开发中,我将按照这本书来回顾结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM