sources/saml: cleanup SLO Implementation

This commit is contained in:
Jens Langhammer 2020-09-26 20:38:38 +02:00
parent 07e20a2950
commit 3663c3c8a1
2 changed files with 2 additions and 26 deletions

View File

@ -1,19 +0,0 @@
{% extends "saml/sp/base.html" %}
{% block content %}
You are now logged out of this Service Provider.<br />
{% if idp_logout_url %}
You are still logged into your Identity Provider.
You should logout of your Identity Provider here:<br />
<a href="{{ idp_logout_url }}">{{ idp_logout_url }}</a>
{#XXX: Maybe this should happen as a redirect, rather than as javascript. #}
{% if autosubmit %}
<script language="javascript">
<!--
/* Automatically submit the form. */
document.location.href = '{{ idp_logout_url }}';
//-->
</script>
{% endif %}
{% endif %}
{% endblock content %}

View File

@ -90,17 +90,12 @@ class SLOView(LoginRequiredMixin, View):
"""Single-Logout-View"""
def dispatch(self, request: HttpRequest, source_slug: str) -> HttpResponse:
"""Replies with an XHTML SSO Request."""
# TODO: Replace with flows
"""Log user out and redirect them to the IdP's SLO URL."""
source: SAMLSource = get_object_or_404(SAMLSource, slug=source_slug)
if not source.enabled:
raise Http404
logout(request)
return render(
request,
"saml/sp/sso_single_logout.html",
{"idp_logout_url": source.slo_url},
)
return redirect(source.slo_url)
class MetadataView(View):