adieu 的 openid 补丁导致 django-openid-consumer 不匹配
我一直在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
补丁可能是为以前版本的 openid 编写的吗?并且您正在使用的型号可能已更改。
May be patch was written for a previous version of openid? and the one you are using could have changed the model.