Skip to content

Commit

Permalink
Merge pull request #6 from stuartf/cas2readme
Browse files Browse the repository at this point in the history
Add info about configuring for cas2 to readme
  • Loading branch information
tptodorov committed Aug 19, 2014
2 parents ba6f1b9 + 75b408e commit d96f0de
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit d96f0de

Please sign in to comment.