{"id":21817,"library":"python-cas","title":"python-cas","description":"Python CAS client library for integrating with CAS (Central Authentication Service) single sign-on servers. Current version 1.7.1, supports Python >=3.10. Release cadence is sporadic.","status":"active","version":"1.7.1","language":"python","source_language":"en","source_url":"https://github.com/python-cas/python-cas","tags":["cas","authentication","sso","saml"],"install":[{"cmd":"pip install python-cas","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Used for all HTTP communication with CAS server","package":"requests","optional":false},{"reason":"Optional, required for SAML responses parsing","package":"lxml","optional":true}],"imports":[{"note":"Module name is 'cas', not 'casclient'","wrong":"from casclient import CASClient","symbol":"CASClient","correct":"from cas import CASClient"},{"note":"","wrong":"","symbol":"CASClientV2","correct":"from cas import CASClientV2"},{"note":"","wrong":"","symbol":"CASClientV3","correct":"from cas import CASClientV3"}],"quickstart":{"code":"from cas import CASClient\n\nclient = CASClient(\n    version=3,\n    service_url='https://myapp.example.com/login',\n    server_url='https://cas.example.com/cas/',\n    verify_ssl_certificate=True\n)\n# If you have a ticket from the CAS server:\nticket = request.GET.get('ticket')\nif ticket:\n    user, attributes, pgtiou = client.verify_ticket(ticket)\n    print(f\"Authenticated user: {user}\")","lang":"python","description":"Basic CAS client setup and ticket verification."},"warnings":[{"fix":"Upgrade to Python >=3.10. Replace any six usage with native Python 3 equivalents.","message":"In v1.7.0, support for Python <3.10 was dropped. Also the dependency on 'six' was removed, which may affect code relying on six.","severity":"breaking","affected_versions":">=1.7.0"},{"fix":"Use CASClient with version=2 or 3.","message":"CASClientV1 is deprecated and may be removed in a future version. Use CASClient with version=3 instead.","severity":"deprecated","affected_versions":"all"},{"fix":"Upgrade to v1.4.0+ or use requests session with custom verify.","message":"The 'verify_ssl_certificate' parameter is available since v1.4.0. In older versions SSL verification is always enabled.","severity":"gotcha","affected_versions":"<1.4.0"},{"fix":"Create one CASClient instance and reuse it.","message":"The client uses requests.Session, which holds cookies. Reuse the client instance for multiple requests to maintain session state.","severity":"gotcha","affected_versions":">=1.6.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install python-cas","cause":"Package not installed.","error":"ImportError: No module named 'cas'"},{"fix":"Use 'from cas import CASClient' instead.","cause":"Wrong import path.","error":"ModuleNotFoundError: No module named 'casclient'"},{"fix":"Upgrade Python to 3.10 or higher, or install an older version of python-cas (e.g., 1.6.0).","cause":"Using too old Python version.","error":"python-cas requires Python '>=3.10' but the running Python is 3.8"},{"fix":"Upgrade to latest version (>=1.1.0).","cause":"Older version of python-cas (<1.1.0) may not have V2.","error":"AttributeError: module 'cas' has no attribute 'CASClientV2'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}