diff options
Diffstat (limited to 'openstack_auth/views.py')
-rw-r--r-- | openstack_auth/views.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/openstack_auth/views.py b/openstack_auth/views.py index 1ef4710..52f2d48 100644 --- a/openstack_auth/views.py +++ b/openstack_auth/views.py @@ -59,12 +59,10 @@ def login(request, template_name=None, extra_context=None, **kwargs): # If the user enabled websso and selects default protocol # from the dropdown, We need to redirect user to the websso url if request.method == 'POST': - protocol = request.POST.get('auth_type', 'credentials') - if utils.is_websso_enabled() and protocol != 'credentials': - region = request.POST.get('region') - origin = utils.build_absolute_uri(request, '/auth/websso/') - url = ('%s/auth/OS-FEDERATION/websso/%s?origin=%s' % - (region, protocol, origin)) + auth_type = request.POST.get('auth_type', 'credentials') + if utils.is_websso_enabled() and auth_type != 'credentials': + auth_url = request.POST.get('region') + url = utils.get_websso_url(request, auth_url, auth_type) return shortcuts.redirect(url) if not request.is_ajax(): |