Fix untrusted dashboard host
The `openstack_auth login` view uses `request.build_absolute_uri` function to build an origin uri when websso is enabled and the WEBSSO_DEFAULT_REDIRECT_PROTOCOL is set. This function doesn't insert the `WEBROOT` variable into uri what causes an error: http://domain.name/auth/websso/ is not a trusted dashboard host Using the `build_absolute_uri` from `utils` module fixes this problem. It generates the right uri: http://domain.name/dashboard/auth/websso/ Change-Id: I94100f66a9f07eb8da75d344cbd120838fe25d1e
This commit is contained in:
parent
fbcc378e3e
commit
2842d7df37
@ -62,7 +62,7 @@ def login(request, template_name=None, extra_context=None, **kwargs):
|
|||||||
utils.is_websso_default_redirect()):
|
utils.is_websso_default_redirect()):
|
||||||
protocol = utils.get_websso_default_redirect_protocol()
|
protocol = utils.get_websso_default_redirect_protocol()
|
||||||
region = utils.get_websso_default_redirect_region()
|
region = utils.get_websso_default_redirect_region()
|
||||||
origin = request.build_absolute_uri('/auth/websso/')
|
origin = utils.build_absolute_uri(request, '/auth/websso/')
|
||||||
url = ('%s/auth/OS-FEDERATION/websso/%s?origin=%s' %
|
url = ('%s/auth/OS-FEDERATION/websso/%s?origin=%s' %
|
||||||
(region, protocol, origin))
|
(region, protocol, origin))
|
||||||
return shortcuts.redirect(url)
|
return shortcuts.redirect(url)
|
||||||
|
Loading…
Reference in New Issue
Block a user