python openid没有';不提供ax或sreg属性
我终于能够让python openid对用户进行身份验证,但我无法创建sreg.SRegResponse或ax.FetchResponse,因为它们返回时没有。这是来自一个谷歌应用程序帐户,我正试着从下面的例子。我听说谷歌的OpenID系统可能有点古怪,需要做一些调整,比如 响应肯定是成功的,但我看到以下错误消息,可能与此相关:python openid没有';不提供ax或sreg属性,python,django,google-app-engine,openid,Python,Django,Google App Engine,Openid,我终于能够让python openid对用户进行身份验证,但我无法创建sreg.SRegResponse或ax.FetchResponse,因为它们返回时没有。这是来自一个谷歌应用程序帐户,我正试着从下面的例子。我听说谷歌的OpenID系统可能有点古怪,需要做一些调整,比如 响应肯定是成功的,但我看到以下错误消息,可能与此相关: Generated checkid_setup request to https://www.google.com/accounts/o8/ud with associ
Generated checkid_setup request to https://www.google.com/accounts/o8/ud with assocication AOQobUdVBCrd-GZRcasn9tD-yOUF0Y8pJLAQrYXODqLxUUjN62G1BXR1
Error attempting to use stored discovery information: <openid.consumer.consumer.TypeURIMismatch: Required type http://specs.openid.net/auth/2.0/signon not found in ['http://specs.openid.net/auth/2.0/server', 'http://openid.net/srv/ax/1.0', 'http://specs.openid.net/extensions/ui/1.0/mode/popup', 'http://specs.openid.net/extensions/ui/1.0/icon', 'http://specs.openid.net/extensions/pape/1.0'] for endpoint <openid.consumer.discover.OpenIDServiceEndpoint server_url='https://www.google.com/accounts/o8/ud' claimed_id=None local_id=None canonicalID=None used_yadis=True >>
Attempting discovery to verify endpoint
Performing discovery on https://www.google.com/accounts/o8/id?id=AItOawkKU4uzJV9Q_FGMECNGsbiXG2caISYMyCw
Received id_res response from https://www.google.com/accounts/o8/ud using association AOQobUdVBCrd-GZRcasn9tD-yOUF0Y8pJLAQrYXODqLxUUjN62G1BXR1
谷歌没有返回AttributeExchange的
schema.openid.net
值,这让我遇到了问题。正如您所提到的,它没有返回任何值,最糟糕的是,当我第一次编写OpenID处理程序时,它曾经工作过
一旦我在实现中切换到axschema值,它就非常有效。例:
URLS = {
'ax_email': 'http://axschema.org/contact/email',
'ax_first': 'http://axschema.org/namePerson/first',
}
...
ax_request = ax.FetchRequest()
ax_request.add(ax.AttrInfo(URLS['ax_email'], required = True))
ax_request.add(ax.AttrInfo(URLS['ax_first'], required = True))
auth_request.addExtension(ax_request)
很抱歉延迟了回复,但我忘记了这个线程,转而处理我项目中的其他事情。当我回到OpenID部分时,我必须回到发布的原始问题,然后再尝试修复,效果很好。宾果!现在可以使用我的金字塔应用程序。谢谢:-)
sreg_request = sreg.SRegRequest(optional=['email', 'nickname'],
required=['dob'])
auth_request.addExtension(sreg_request)
# Add Attribute Exchange request information.
ax_request = ax.FetchRequest()
# XXX - uses myOpenID-compatible schema values, which are
# not those listed at axschema.org.
ax_request.add(ax.AttrInfo('http://schema.openid.net/namePerson',
required=True))
ax_request.add(ax.AttrInfo('http://schema.openid.net/contact/web/default',
required=False, count=ax.UNLIMITED_VALUES))
auth_request.addExtension(ax_request)
URLS = {
'ax_email': 'http://axschema.org/contact/email',
'ax_first': 'http://axschema.org/namePerson/first',
}
...
ax_request = ax.FetchRequest()
ax_request.add(ax.AttrInfo(URLS['ax_email'], required = True))
ax_request.add(ax.AttrInfo(URLS['ax_first'], required = True))
auth_request.addExtension(ax_request)