sources/saml: cleanup SLO Implementation
This commit is contained in:
		@ -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 %}
 | 
			
		||||
@ -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):
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user