def get_context_data(self, **kwargs):
        target = self.request.GET.get('TARGET')

        assert defused_etree, '/samlValidate endpoint requires defusedxml to be installed'

        try:
            root = defused_etree.parse(self.request, forbid_dtd=True).getroot()
            ticket = root.find('.//{urn:oasis:names:tc:SAML:1.0:protocol}AssertionArtifact').text
        except (defused_etree.ParseError, __HOLE__, AttributeError):
            ticket = None

        st, pgt, error = validate_service_ticket(target, ticket, None, require_https=True)
        attributes = get_attributes(st.user, st.service) if st else None
        return {'ticket': st, 'pgt': pgt, 'error': error, 'attributes': attributes}
dataset/ETHPy150Open jbittel/django-mama-cas/mama_cas/views.py/SamlValidateView.get_context_data