3
我已經能夠最終獲得python-openid來驗證用戶,但我無法創建sreg.SRegResponse或ax.FetchResponse,因爲他們回來了作爲無。這是來自Google Apps帳戶,我試圖按照https://github.com/openid/python-openid/tree/master/examples/djopenid的示例進行操作。我聽說過谷歌的OpenID系統可以是一個有點古怪,需要一些調整,像Retrieve OpenID AX attributes from Google/Yahoo in Railspython-openid不提供ax或sreg屬性
response = c.complete(request_args, return_to)
sreg_response = sreg.SRegResponse.fromSuccessResponse(response)
ax_response = ax.FetchResponse.fromSuccessResponse(response)
的反應肯定是回來是成功的,但我看到下面的錯誤消息,這可能與:
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
這是我的設置。
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)
對不起,延遲響應,但我忘了這個線程,並轉移到我的項目中的其他事情。當我回到OpenID部分時,我不得不回到在嘗試修復之前發佈的原始問題,這很好。 – voodoogiant 2011-07-02 19:21:36
賓果!現在與我的金字塔應用程序合作。謝謝 :-) – 2013-03-11 07:18:38