Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

bethanylong/bottle-cas

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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

About

A CAS Client written with bottle.py

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%