returns saml logout ticket info
3849
def get_saml_slos(cls, logout_request):
        """"""
        try:
            root = etree.fromstring(logout_request)
            return root.xpath(
                "//samlp:SessionIndex",
                namespaces={'samlp': "urn:oasis:names:tc:SAML:2.0:protocol"})
        except etree.XMLSyntaxError:
            return None
1000598
def logout_callback():
    
    resp = make_response('Logging Out')
    resp.set_cookie('sub', 'null', expires=0)
    resp.set_cookie('session_id', 'null', expires=0)
    return resp
742983
def get_jsapi_ticket(self):
        
        ticket_key = '{}_jsapi_ticket'.format(self._client.corp_id)
        expires_at_key = '{}_jsapi_ticket_expires_at'.format(self._client.corp_id)
        ticket = self.session.get(ticket_key)
        expires_at = self.session.get(expires_at_key, 0)
        if not ticket or expires_at < int(time.time()):
            jsapi_ticket = self.get_ticket()
            ticket = jsapi_ticket['ticket']
            expires_at = int(time.time()) + int(jsapi_ticket['expires_in'])
            self.session.set(ticket_key, ticket)
            self.session.set(expires_at_key, expires_at)
        return ticket
719680
def check_status(self):
        
        status = OneLogin_Saml2_Utils.get_status(self.document)
        code = status.get('code', None)
        if code and code != OneLogin_Saml2_Constants.STATUS_SUCCESS:
            splited_code = code.split(':')
            printable_code = splited_code.pop()
            status_exception_msg = 'The status code of the Response was not Success, was %s' % printable_code
            status_msg = status.get('msg', None)
            if status_msg:
                status_exception_msg += ' -> ' + status_msg
            raise OneLogin_Saml2_ValidationError(
                status_exception_msg,
                OneLogin_Saml2_ValidationError.STATUS_CODE_IS_NOT_SUCCESS
            )
36878
def get_ticket(self, ticket_id):
        """"""
        url = 'tickets/%d' % ticket_id
        ticket = self._api._get(url)
        return Ticket(**ticket)
709431
def get_issuer(request):
        

        elem = OneLogin_Saml2_XML.to_etree(request)
        issuer = None
        issuer_nodes = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:Issuer')
        if len(issuer_nodes) == 1:
            issuer = OneLogin_Saml2_XML.element_text(issuer_nodes[0])
        return issuer
968654
def verify_ticket(self, ticket):
        
        params = [('ticket', ticket), ('service', self.service_url)]
        if self.renew:
            params.append(('renew', 'true'))
        url = (urllib_parse.urljoin(self.server_url, 'validate') + '?' +
               urllib_parse.urlencode(params))
        page = urllib_request.urlopen(url)
        try:
            verified = page.readline().strip()
            if verified == b'yes':
                charset = self.get_page_charset(page, default="ascii")
                user = self.u(page.readline().strip(), charset)
                return user, None, None
            else:
                return None, None, None
        finally:
            page.close()
1347119
def unbind(self, ticket, device_id, user_id):
        
        return self._post(
            'unbind',
            data={
                'ticket': ticket,
                'device_id': device_id,
                'openid': user_id
            }
        )
288109
public function sls()
    {
        $error = $this->saml2Auth->sls(config('saml2_settings.retrieveParametersFromServer'));
        if (!empty($error)) {
            throw new \Exception("Could not log out");
        }

        return redirect(config('saml2_settings.logoutRoute')); //may be set a configurable default
    }
325383
public function getIssuer()
    {
        $issuer = null;
        $issuerNodes = $this->_query('/samlp:LogoutResponse/saml:Issuer');
        if ($issuerNodes->length == 1) {
            $issuer = $issuerNodes->item(0)->textContent;
        }
        return $issuer;
    }
767175
def zapier_cancel_hook(request):
    '''
    
    '''
    if request.META.get('HTTP_X_ZAPIER_SECRET', None) != settings.WAFER_TICKETS_SECRET:
        raise PermissionDenied('Incorrect secret')

    # This is required for python 3, and in theory fine on python 2
    payload = json.loads(request.body.decode('utf8'))
    ticket = Ticket.objects.filter(barcode=payload['barcode'])
    if ticket.exists():
        # delete the ticket
        ticket.delete()
    return HttpResponse("Cancelled\n", content_type='text/plain')
276255
def _resume_with_session_ticket(
            self,
            server_info: ServerConnectivityInfo,
            ssl_version_to_use: OpenSslVersionEnum,
    ) -> TslSessionTicketSupportEnum:
        
        # Connect to the server and keep the SSL session
        try:
            session1 = self._resume_ssl_session(server_info, ssl_version_to_use, should_enable_tls_ticket=True)
        except SslHandshakeRejected:
            if server_info.highest_ssl_version_supported >= OpenSslVersionEnum.TLSV1_3:
                return TslSessionTicketSupportEnum.FAILED_ONLY_TLS_1_3_SUPPORTED
            else:
                raise

        try:
            # Recover the TLS ticket
            session1_tls_ticket = self._extract_tls_session_ticket(session1)
        except IndexError:
            return TslSessionTicketSupportEnum.FAILED_TICKET_NOT_ASSIGNED

        # Try to resume that session using the TLS ticket
        session2 = self._resume_ssl_session(server_info, ssl_version_to_use, session1, should_enable_tls_ticket=True)
        try:
            # Recover the TLS ticket
            session2_tls_ticket = self._extract_tls_session_ticket(session2)
        except IndexError:
            return TslSessionTicketSupportEnum.FAILED_TICKET_NOT_ASSIGNED

        # Finally, compare the two TLS Tickets
        if session1_tls_ticket != session2_tls_ticket:
            return TslSessionTicketSupportEnum.FAILED_TICKED_IGNORED

        return TslSessionTicketSupportEnum.SUCCEEDED
455744
def get_logout_information(self, logout_token):
        """"""
        data = dict(logout_token=logout_token, app_id=self.app_id, app_secret=self.app_secret)
        logout_response = self._call('POST', self.logout_url, params=data)
        clef_user_id = logout_response.get('clef_id')
        return clef_user_id
677152
def logout(self):
        
        ret = False
        if self.login_result is True:
            ret = self.__get_status_code(self.__request('logout')) == 200
            self.login_result = None
        return ret
711317
def verify_proxy_ticket(ticket, service):
    

    params = {'ticket': ticket, 'service': service}

    url = (urljoin(settings.CAS_SERVER_URL, 'proxyValidate') + '?' +
           urlencode(params))

    page = urlopen(url)

    try:
        response = page.read()
        tree = ElementTree.fromstring(response)
        if tree[0].tag.endswith('authenticationSuccess'):
            username = tree[0][0].text
            proxies = []
            if len(tree[0]) > 1:
                for element in tree[0][1]:
                    proxies.append(element.text)
            return {"username": username, "proxies": proxies}
        else:
            return None
    finally:
        page.close()
1663
def get_ticket(self, service):
        """"""
        return self.auth_tickets \
            .filter(expires__gt=datetime.now(timezone.utc), service=service) \
            .last()
372604
def fetch_jsapi_ticket
      path = '/get_jsapi_ticket'
      response = fire_request path, {access_token: refreshed_access_token, type: :jsapi}, method: :get
      return response[:ticket], response
    end