cas client
Project description
Flask-CasLite
cas client
Install
pip install Flask-CasLite
Example
from flask import Flask, session, request
from flask_caslite import CasLite, login_required, handle_logout
app = Flask(__name__)
app.config.update(
SECRET_KEY = 'hello',
CAS_SERVER = 'https://sso.atbyd.com/cas',
CAS_VERSION = 'v2',
CAS_TOKEN_SESSION_KEY = '_CAS_TOKEN',
CAS_USERNAME_SESSION_KEY = 'CAS_USERNAME',
CAS_ATTRIBUTES_SESSION_KEY = 'CAS_ATTRIBUTES'
)
CasLite(app)
@app.before_request
def handle_cas_logout():
print(handle_logout(request))
@app.route('/', methods=['GET'])
def index():
session['hello'] ='world'
return 'Hello, World'
@app.route('/private_page/', methods=['GET'])
@login_required
def cas():
cas_user =session.get('CAS_USERNAME')
return 'Hello, ' + cas_user + session.get('hello','')
if __name__ == "__main__":
app.run(debug=True,host='0.0.0.0')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Flask-CasLite-0.0.1.tar.gz
(3.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Flask-CasLite-0.0.1.tar.gz.
File metadata
- Download URL: Flask-CasLite-0.0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eead1ca121c4f82a28028f5930e4572080680b187e2713aa9e3a0097a57c5273
|
|
| MD5 |
61299b8c486370286aac0b171871ffc1
|
|
| BLAKE2b-256 |
8b42c38c950936e6cb781149b2601c90bf01dd893f08f3f8ccfdaf8286cf4490
|
File details
Details for the file Flask_CasLite-0.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: Flask_CasLite-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29147d6f641ad76d0dcea7cf760c96c72d1888da5d5feec2ba2d2c71a0a4960
|
|
| MD5 |
7a959191036dcc647b36c33cab6b8f6d
|
|
| BLAKE2b-256 |
b80cec1b9731a45c328b803afac84c8667f0fce94d76ad15418cc009ca08b125
|