Commit b70de70b by Carlos Andrés Rocha

Get OpenID XRDS url host from request

Replaced the previous method of getting it from HTTP_POST to use
django's mechanism, which may or may not use HTTP_HOST. However if an
attacker changes the request header, there is not much he can do since
he cannot recreate the association nonce.
parent 85495c95
...@@ -271,10 +271,7 @@ def get_xrds_url(resource, request): ...@@ -271,10 +271,7 @@ def get_xrds_url(resource, request):
""" """
Return the XRDS url for a resource Return the XRDS url for a resource
""" """
host = request.META['HTTP_HOST'] host = request.get_host()
if not host.endswith('edx.org'):
return None
location = host + '/openid/provider/' + resource + '/' location = host + '/openid/provider/' + resource + '/'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment