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"""
 | 
					    """Single-Logout-View"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def dispatch(self, request: HttpRequest, source_slug: str) -> HttpResponse:
 | 
					    def dispatch(self, request: HttpRequest, source_slug: str) -> HttpResponse:
 | 
				
			||||||
        """Replies with an XHTML SSO Request."""
 | 
					        """Log user out and redirect them to the IdP's SLO URL."""
 | 
				
			||||||
        # TODO: Replace with flows
 | 
					 | 
				
			||||||
        source: SAMLSource = get_object_or_404(SAMLSource, slug=source_slug)
 | 
					        source: SAMLSource = get_object_or_404(SAMLSource, slug=source_slug)
 | 
				
			||||||
        if not source.enabled:
 | 
					        if not source.enabled:
 | 
				
			||||||
            raise Http404
 | 
					            raise Http404
 | 
				
			||||||
        logout(request)
 | 
					        logout(request)
 | 
				
			||||||
        return render(
 | 
					        return redirect(source.slo_url)
 | 
				
			||||||
            request,
 | 
					 | 
				
			||||||
            "saml/sp/sso_single_logout.html",
 | 
					 | 
				
			||||||
            {"idp_logout_url": source.slo_url},
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class MetadataView(View):
 | 
					class MetadataView(View):
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user