Welcome!
Everything is fine.

CAS

Today, we'll talk about authenticating users with the CAS server at Wellesley. CAS essentially allows us to punt having to manage passwords and logins.

Plan

  1. Announcements
  2. We'll go over the basics of CAS
  3. Quiz Questions
  4. Breakout sessions in project teams

Announcements

  1. Grading status
  2. Enjoy the break. Take some time for well-deserved R&R. I plan to!

CAS Highlights

  • flask_cas creates a cas.login handler for logins
  • You can decide how to format that as a button in your app
  • When the user clicks the button, flask transfers the user to the CAS server
  • They authenticate. If they are successful....
  • CAS transfers back to your app (at a route of your choosing), and
  • puts useful info in the session, particularly
  • CAS_USERNAME, which is the user's official Wellesley username, e.g. sanderso

All the coding details are in the cas folder in ~cs304/pub/downloads/cas

Quiz Questions

I'll answer your quiz questions

Demo (if desired)

Here's a demo of the PHP version working for account requests

Here's what you have to do to use Wellesley's CAS server. We can do this together in class.

  • install flask_cas using pip
  • fix the bug
  • import flask_cas into your app.py
  • configure it with the CAS server, URLs, etc. Values below
  • start with a different port, described below

Checklist

Here's a checklist for running the app, which you can adapt for running your project code.

Once Only

  1. activate venv
  2. install flask_cas
  3. install my patch using install-scott-routing.sh
cd ~/cs304
source venv/bin/activate
pip install flask_cas
cp -r ~cs304/pub/downloads/cas cas
cd cas
bash install-scott-routing.sh

Each Time

  1. Start VPN (if and only if you are outside the Wellesley firewall)
  2. activate venv
  3. run on port 1943-1952
cd ~/cs304
source venv/bin/activate
cd cas
python app.py 1952

Breakout

You're welcome to work on your projects now.