Git Product home page Git Product logo

cas-sample-python-webapp's Introduction

Overview

This is a sample Python web application using Flask that is protected via an Apereo CAS server using the Flask CAS extension.

Requirements

  • Python
$ python --version
Python 2.7.10
  • Pip
$ pip --version
pip 9.0.1 from /Library/Python/2.7/site-packages (python 2.7)

Flask CAS Extension

You may need to download/install the CAS Flask extension from source locally to obtain a bug fix that helps with CAS attribute parsing. The bug fix, as of this writing, is not yet released.

git clone [email protected]:cameronbwhite/Flask-CAS.git
cd Flask-CAS
sudo python setup.py install

If you wish to not install the plugin from source, simply execute:

sudo pip install Flask-CAS

Run

$ python app.py

...

* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 120-601-740

Test

Navigate to http://localhost:5000 and click on the login button. You will be redirected to a CAS server to authenticate and once you return, you should see the authenticated user id plus any and all attributes that the server may have authorized you to receive.

image

Remember that the application must be registered with the CAS server, and should be authorized to authenticate.

You can find valid username and password under cas.authn.accept.users part of CAS configuration part of CAS server dashboard. It's casuser:Mellon for version 5.

Configuration

CAS configuration may be specified in app.py:

app.config['CAS_SERVER'] = 'https://jasigcas.herokuapp.com' 
app.config['CAS_AFTER_LOGIN'] = 'secure'

For all other relevant settings, please refer to the Flask CAS extension project.

cas-sample-python-webapp's People

Contributors

hadisfr avatar hellt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.