From 75b408ea3960b00064cb06a9e92b79cf366663af Mon Sep 17 00:00:00 2001 From: "D. Stuart Freeman" Date: Tue, 19 Aug 2014 13:13:29 -0400 Subject: [PATCH] Add info about configuring for cas2 to readme --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index cc3d6db..11d1279 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,28 @@ Here is how you can use them: }); })); +## CAS 2.0 configuration +CAS 2.0 will work with the CAS 3.0 configuration, but you need to set the validation endpoint. + + passport.use(new (require('passport-cas').Strategy)({ + version: 'CAS3.0', + ssoBaseURL: 'http://www.example.com/', + serverBaseURL: 'http://localhost:3000/cas', + validateURL: '/serviceValidate' + }, function(profile, done) { + var login = profile.user; + + User.findOne({login: login}, function (err, user) { + if (err) { + return done(err); + } + if (!user) { + return done(null, false, {message: 'Unknown user'}); + } + return done(null, user); + }); + })); + ## License [The MIT License](http://opensource.org/licenses/MIT)