Casable
This project will be the Casable Project to enable NodeJS express applications to authenticate using CAS.
Useage:
var cas = require('casable');
var auth = cas.authentication('http://cas.tw.com/cas', {logoutPath:'/unsecure', casVersion:'2.0'});
app.get('/securePage', auth, function(request, response) {
var username = request.authenticatedUser.id
response.send(username + "
Logout");
});
Simply define a URL like this for logout functionality
app.get('/logout', auth, function(request, response) {
});
Make sure that these session and cookie routes are enabled
app.use(express.cookieParser());
app.use(express.session({secret: 'abcxyz'}));