adieu 的 openid 补丁导致 django-openid-consumer 不匹配

发布于 2024-10-20 14:32:31 字数 2947 浏览 1 评论 0原文

我一直在使用 django 和 openid 使用 django-openid-consumer 中间件,它通常可以工作。但是,我在使用 Google Apps 帐户登录时遇到问题(这会将我重定向到我的普通 Gmail 帐户)。一名谷歌员工建议安装 adieu-python-openid,据说其中包含一个处理谷歌 OpenID 模糊性的补丁。不管怎样,安装这个版本的 openid 后,我遇到了版本不匹配的问题。我看到 adieu 的 init.py 中声明的版本。是否也需要在类中声明?

Environment:

Request Method: GET
Request URL: http://innovationsimple.net/testapp/openid/complete/?janrain_nonce=2011-03-05T15%3A27%3A04Zx26tny&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fud&openid.response_nonce=2011-03-05T15%3A27%3A08Zk4PS-g2XYczSVw&openid.return_to=http%3A%2F%2Finnovationsimple.net%2Ftestapp%2Fopenid%2Fcomplete%2F%3Fjanrain_nonce%3D2011-03-05T15%253A27%253A04Zx26tny&openid.assoc_handle=AOQobUcnYBDagAx3JaBN3y5YODDaZqypJ1Se-IZTcZwnbmSk65JH2VV2&openid.signed=op_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle%2Cns.ext1%2Cext1.mode%2Cext1.type.email%2Cext1.value.email&openid.sig=XG5sa7SwTMptLa2LOMqt5sNS9x0%3D&openid.identity=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawku4cndu1aLsJt3DcI4yKyFPMU2JoOeggA&openid.claimed_id=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawku4cndu1aLsJt3DcI4yKyFPMU2JoOeggA&openid.ns.ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch_response&openid.ext1.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.value.email=strattonbrazil%40gmail.com
Django Version: 1.2.5
Python Version: 2.4.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'staticfiles',
 'django_openid_consumer',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'crm']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django_openid_consumer.middleware.OpenIDMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware')


Traceback:
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response
  100.                     response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.4/site-packages/django_openid_consumer-0.1.1-py2.4.egg/django_openid_consumer/views.py" in complete
  154.         return on_success(request, openid_response.identity_url, openid_response)
File "/usr/lib/python2.4/site-packages/django_openid_consumer-0.1.1-py2.4.egg/django_openid_consumer/views.py" in default_on_success
  172.     request.session['openids'].append(from_openid_response(openid_response))
File "/usr/lib/python2.4/site-packages/django_openid_consumer-0.1.1-py2.4.egg/django_openid_consumer/util.py" in from_openid_response
  123.         if openid.__version__ < '2.1.0':

Exception Type: AttributeError at /openid/complete/
Exception Value: O

OpenID instance has no attribute '__version__'

I've been using the django with openid using the django-openid-consumer middleware, which works generally. However, I was having an issue logging in using an account from Google apps (which would redirect me to my normal gmail account). A google employee recommended installing adieu-python-openid, which supposedly contained a patch that handled Google's OpenID obscurity. Anyways, after installing this version of openid, I'm getting a version mismatch. I see the version declared in adieu's init.py. Does one need to be declared inside a class as well?

Environment:

Request Method: GET
Request URL: http://innovationsimple.net/testapp/openid/complete/?janrain_nonce=2011-03-05T15%3A27%3A04Zx26tny&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fud&openid.response_nonce=2011-03-05T15%3A27%3A08Zk4PS-g2XYczSVw&openid.return_to=http%3A%2F%2Finnovationsimple.net%2Ftestapp%2Fopenid%2Fcomplete%2F%3Fjanrain_nonce%3D2011-03-05T15%253A27%253A04Zx26tny&openid.assoc_handle=AOQobUcnYBDagAx3JaBN3y5YODDaZqypJ1Se-IZTcZwnbmSk65JH2VV2&openid.signed=op_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle%2Cns.ext1%2Cext1.mode%2Cext1.type.email%2Cext1.value.email&openid.sig=XG5sa7SwTMptLa2LOMqt5sNS9x0%3D&openid.identity=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawku4cndu1aLsJt3DcI4yKyFPMU2JoOeggA&openid.claimed_id=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawku4cndu1aLsJt3DcI4yKyFPMU2JoOeggA&openid.ns.ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch_response&openid.ext1.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.value.email=strattonbrazil%40gmail.com
Django Version: 1.2.5
Python Version: 2.4.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'staticfiles',
 'django_openid_consumer',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'crm']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django_openid_consumer.middleware.OpenIDMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware')


Traceback:
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response
  100.                     response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.4/site-packages/django_openid_consumer-0.1.1-py2.4.egg/django_openid_consumer/views.py" in complete
  154.         return on_success(request, openid_response.identity_url, openid_response)
File "/usr/lib/python2.4/site-packages/django_openid_consumer-0.1.1-py2.4.egg/django_openid_consumer/views.py" in default_on_success
  172.     request.session['openids'].append(from_openid_response(openid_response))
File "/usr/lib/python2.4/site-packages/django_openid_consumer-0.1.1-py2.4.egg/django_openid_consumer/util.py" in from_openid_response
  123.         if openid.__version__ < '2.1.0':

Exception Type: AttributeError at /openid/complete/
Exception Value: O

OpenID instance has no attribute '__version__'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怪我太投入 2024-10-27 14:32:31

补丁可能是为以前版本的 openid 编写的吗?并且您正在使用的型号可能已更改。

May be patch was written for a previous version of openid? and the one you are using could have changed the model.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文