Skip to main content

A pypi-downloadable version of Jon Rifkin's pycas client.

Project description

Notice: this seems to not quite fit the needs of the project it was intended for. It will remain in its current form, but consider the package no longer maintained. Feel free to improve it further if you choose, and submit pull requests on github.


This is a copy of Jon Rifkin’s Python CAS client. The original can be found at This fork lives at and on Pypi.

The original appears to have not been updated for some time now, and is not on Pypi. This is an attempt to rectify that situation.

Potential things to be added:
  • Unit tests
  • Better security:
    • Remove default secret key
    • Better yet, ditch md5 entirely
    • Add signed cookies (e.g. itsdangerous)
  • Enforce the timeout


pip install pycas


The pycas CAS client provides CAS authentication for your Python CGI web application.



  1. Add four lines to your Python Web app like this:

    import pycas
    CAS_SERVER  = "https://casserver.mydomain"
    SERVICE_URL = "http://webserver.mydomain/cgi-bin/"
    status, userid, cookie = pycas.login(CAS_SERVER, SERVICE_URL)
  2. Process the returned variables:

    status carries the success or failure status.
    userid is the user's account name.
    cookie is the header string to send to the client if it's not empty.

For more information, see comments in the Python code.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pycas, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size pycas-0.0.3.tar.gz (6.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page