From e7bc916ef76d775cd1aebffbc487b4449810a0b1 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 22 Jun 2015 23:20:20 +0200 Subject: [PATCH] Use URL for idp-initiated SSO in the user dashboard (#7624) --- src/authentic2_pratic/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/authentic2_pratic/views.py b/src/authentic2_pratic/views.py index 38a01f1..ff8da11 100644 --- a/src/authentic2_pratic/views.py +++ b/src/authentic2_pratic/views.py @@ -16,6 +16,7 @@ from authentic2.constants import AUTHENTICATION_EVENTS_SESSION_KEY from authentic2.manager.views import AjaxFormViewMixin, \ ActionMixin, OtherActionsMixin, TitleMixin, Action from authentic2.manager.user_views import UserEditView, UserAddView +from authentic2.utils import make_url from . import models, tables, forms, constants @@ -387,11 +388,14 @@ def get_service_links(request): if service_instance.service.is_global: name = service_instance.service.name slug = service_instance.service.slug - url = service_instance.service.service_url else: name = service_instance.service.name slug = service_instance.slug - url = service_instance.service_url + if service_instance.metadata_url: + url = make_url('a2-idp-saml2-idp-sso', + params={'provider_id': service_instance.metadata_url}) + else: + url = service_instance.url service_links.append((name, url, slug, needed_authent)) return service_links