A CAS Client written with bottle.py
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bottle_cas
examples
.gitignore
.travis.yml
LICENSE
README.md
requirements.txt
setup.py
tests.py

README.md

bottle-cas

Build Status

A CAS Client written with bottle.py

Usage

from bottle import route, run, request, Bottle
from bottle_cas.client import CASClient
from bottle_cas.client import CASMiddleware
cas = CASClient()

app = Bottle()
app = CASMiddleware(app)

@route('/')
@cas.require
def index():
    user = request.environ['REMOTE_USER']
    return "Hello %s." % user

run(app=app)

A more complete example can be found within the client (bottle_cas/client.py). Try running it!

Installation

python setup.py build
python setup.py install

Configuration

Configuration should be done in the config.py file located in your python site-packages

cd /usr/lib/python2.7/site-packages/bottle_cas
vim config.py

You really should only need to edit CAS_SERVER and SECRET to get this working.

CAS_SERVER = "https://sso.domian.com" # sso server you would like to auth against
CAS_LOGOUT_URL = "/cas/logout" # The url of the logout
CAS_COOKIE = "CAS" # Name of the cookie
COOKIE_PATH = '/'
MAX_COOKIE_AGE = 1
SECRET = "PLOX_MAKE_DIS_SECRET"
DEBUG = 1