klokantech / facebook-openid

Facebook OpenID Provider - allows to log in with Facebook account into any OpenID service, including Google AppEngine Federated Login
http://facebook-openid.appspot.com/
10 stars 6 forks source link

HTTPS Seems broken #2

Open l-dobrev opened 10 years ago

l-dobrev commented 10 years ago

When using https://facebook-openid.appspot.com/ as OpenID address service URL seems to be broken resulting in the browser attempting to connect to the HTTPS port with straight HTTP, which does not work. The XRD says

<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)">
<XRD>
  <Service priority="0">
    <Type>http://specs.openid.net/auth/2.0/server</Type>
    <Type>http://specs.openid.net/auth/2.0/signon</Type>
    <Type>http://openid.net/srv/ax/1.0</Type>
    <URI>http://facebook-openid.appspot.com:443/server</URI>
  </Service>
</XRD>
</xrds:XRDS>

The protocol should be changed to HTTPS whenever https is used to obtain the XRD.

l-dobrev commented 10 years ago

My Python-fu is not that strong, but I believe that the culprit is in the provider.py at line 102 in the InitializeOpenId() method. There it constructs the URL of the service, but does so a bit blindly. This http://www.python.org/dev/peps/pep-0333/#url-reconstruction shows a good way to construct the service URL based on the request, including server address, port and protocol.

klokan commented 10 years ago

We are not using this service in the company. We have a rewritten version of the code embedded in Georeferencer (http://www.klokantech.com/georeferencer).

You can patch the code and deploy it on an alternative appengine project url.

If you provide a correct pull request with this fixed I will push it to the https://facebook-openid.appspot.com/ as well.

If you want us to fix it and you are willing to cover our working time on this task please let me know.