code: 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()
docs: Verifies CAS 2.0+ XML-based proxy ticket.
  
      :param: ticket
      :param: service
  
      Returns username on success and None on failure.