diff --git a/mellon/locale/fr/LC_MESSAGES/django.mo b/mellon/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 0000000..e0530d5 Binary files /dev/null and b/mellon/locale/fr/LC_MESSAGES/django.mo differ diff --git a/mellon/templates/mellon/.authentication_failed.html.swp b/mellon/templates/mellon/.authentication_failed.html.swp new file mode 100644 index 0000000..c9782fd Binary files /dev/null and b/mellon/templates/mellon/.authentication_failed.html.swp differ diff --git a/mellon/templates/mellon/pop_iframe.html b/mellon/templates/mellon/pop_iframe.html new file mode 100644 index 0000000..84fb425 --- /dev/null +++ b/mellon/templates/mellon/pop_iframe.html @@ -0,0 +1,8 @@ +{% extends "mellon/base.html" %} +{% load i18n %} + +{% block mellon_extra_scripts %} + +{% endblock %} diff --git a/mellon/views.py b/mellon/views.py index a319455..a74948a 100644 --- a/mellon/views.py +++ b/mellon/views.py @@ -142,8 +142,16 @@ class LoginView(LogMixin, View): return render(request, 'mellon/user_not_found.html', { 'saml_attributes': attributes }) request.session['lasso_session_dump'] = login.session.dump() + iframe = login.msgRelayState.startswith('iframe+') + if iframe: + login.msgRelayState = login.msgRelayState[len('iframe+'):] next_url = login.msgRelayState or resolve_url(settings.LOGIN_REDIRECT_URL) - return HttpResponseRedirect(next_url) + if iframe: + return render(request, 'mellon/pop_iframe.html', { + 'next_url': next_url, + }) + else: + return HttpResponseRedirect(next_url) def continue_sso_artifact_get(self, request): idp_message = None @@ -210,6 +218,7 @@ class LoginView(LogMixin, View): def get(self, request, *args, **kwargs): '''Initialize login request''' + iframe = 'iframe' in request.GET if 'SAMLart' in request.GET: return self.continue_sso_artifact_get(request) next_url = request.GET.get('next') @@ -239,6 +248,8 @@ class LoginView(LogMixin, View): req_authncontext.authnContextClassRef = authn_classref if next_url: login.msgRelayState = next_url + if iframe: + login.msgRelayState = 'iframe+' + (login.msgRelayState or '') login.buildAuthnRequestMsg() except lasso.Error, e: return HttpResponseBadRequest('error initializing the '