Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
Support using the url_root as trust_root. [Patrick Uiterwijk]
  • Loading branch information
puiterwijk committed Oct 24, 2014
1 parent 8cc2f8e commit 1a1fc96599ee0a8482704dc07649d79f10cf9c98
Showing 2 changed files with 16 additions and 4 deletions.
@@ -1,6 +1,11 @@
1.2.4 (2014-??-??)
1.2.4 (2014-10-24)


- Support using the url_root as trust_root. [Patrick Uiterwijk]

1.2.3 (2014-10-08)
@@ -335,10 +335,13 @@ def create_app():
default the user is redirected back to the
application's index in that case.
:param extension_responses: a list of OpenID Extensions Response class.
:param safe_roots: a list of trust roots to support returning to
:param url_root_as_trust_root: whether to use the url_root as trust_root

def __init__(self, app=None, fs_store_path=None, store_factory=None,
fallback_endpoint=None, extension_responses=None, safe_roots=None):
fallback_endpoint=None, extension_responses=None,
safe_roots=None, url_root_as_trust_root=False):
# backwards compatibility support
if isstring(app):
from warnings import warn
@@ -368,6 +371,7 @@ def __init__(self, app=None, fs_store_path=None, store_factory=None,
self.safe_roots = [safe_roots]
self.safe_roots = safe_roots
self.url_root_as_trust_root = url_root_as_trust_root

def init_app(self, app):
"""This callback can be used to initialize an application for the
@@ -549,6 +553,9 @@ def try_login(self, identity_url, ask_for=None, ask_for_optional=None, extension
except discover.DiscoveryFailure:
self.signal_error(u'The OpenID was invalid')
return redirect(self.get_current_url())
trust_root = request.host_url
return redirect(auth_request.redirectURL(request.host_url,
if self.url_root_as_trust_root:
trust_root = request.url_root
trust_root = request.host_url
return redirect(auth_request.redirectURL(trust_root,

0 comments on commit 1a1fc96

Please sign in to comment.