Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

reasonable (and SSL-compatible) default for OpenID realm

  • Loading branch information...
commit 94c25d5f617822c5d953940840b751c2cdba34ef 1 parent 62bc2e4
@danielrobbins danielrobbins authored
Showing with 5 additions and 1 deletion.
  1. +1 −1  tornado/auth.py
  2. +4 −0 tornado/httpserver.py
View
2  tornado/auth.py
@@ -105,7 +105,7 @@ def _openid_args(self, callback_uri, ax_attrs=[], oauth_scope=None):
"openid.identity":
"http://specs.openid.net/auth/2.0/identifier_select",
"openid.return_to": url,
- "openid.realm": "http://" + self.request.host + "/",
+ "openid.realm": self.request.base_url(),
"openid.mode": "checkid_setup",
}
if ax_attrs:
View
4 tornado/httpserver.py
@@ -414,6 +414,10 @@ def full_url(self):
"""Reconstructs the full URL for this request."""
return self.protocol + "://" + self.host + self.uri
+ def base_url(self):
+ """Reconstructs the base URL for this request (used as default OpenID realm)."""
+ return self.protocol + "://" + self.host
+
def request_time(self):
"""Returns the amount of time it took for this request to execute."""
if self._finish_time is None:
Please sign in to comment.
Something went wrong with that request. Please try again.