[Python-checkins] r77565 - tracker/instances/python-dev/extensions/openid_login.py
martin.v.loewis
python-checkins at python.org
Sun Jan 17 10:12:52 CET 2010
Author: martin.v.loewis
Date: Sun Jan 17 10:12:52 2010
New Revision: 77565
Log:
Implement RP discovery.
Modified:
tracker/instances/python-dev/extensions/openid_login.py
Modified: tracker/instances/python-dev/extensions/openid_login.py
==============================================================================
--- tracker/instances/python-dev/extensions/openid_login.py (original)
+++ tracker/instances/python-dev/extensions/openid_login.py Sun Jan 17 10:12:52 2010
@@ -112,7 +112,19 @@
# parse again to get cgi kind of result
query = cgi.parse_qs(self.client.env['QUERY_STRING'])
if 'openid.identity' not in query:
- return self.rp_discovery()
+ # RP discovery
+ payload = '''<xrds:XRDS xmlns:xrds="xri://$xrds"
+ xmlns="xri://$xrd*($v*2.0)">
+ <XRD>
+ <Service priority="1">
+ <Type>http://specs.openid.net/auth/2.0/return_to</Type>
+ <URI>%s?@action=openid_return</URI>
+ </Service>
+ </XRD>
+ </xrds:XRDS>
+ ''' % self.base
+ self.client.additional_headers['Content-Type'] = 'application/xrds+xml'
+ return payload
if 'openid.response_nonce' in query:
nonce = query['openid.response_nonce'][0]
stamp = openid.parse_nonce(nonce)
More information about the Python-checkins
mailing list