Skip to content

Commit 75b408e

Browse files
committed
Add info about configuring for cas2 to readme
1 parent ba6f1b9 commit 75b408e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,28 @@ Here is how you can use them:
9696
});
9797
}));
9898

99+
## CAS 2.0 configuration
100+
CAS 2.0 will work with the CAS 3.0 configuration, but you need to set the validation endpoint.
101+
102+
passport.use(new (require('passport-cas').Strategy)({
103+
version: 'CAS3.0',
104+
ssoBaseURL: 'http://www.example.com/',
105+
serverBaseURL: 'http://localhost:3000/cas',
106+
validateURL: '/serviceValidate'
107+
}, function(profile, done) {
108+
var login = profile.user;
109+
110+
User.findOne({login: login}, function (err, user) {
111+
if (err) {
112+
return done(err);
113+
}
114+
if (!user) {
115+
return done(null, false, {message: 'Unknown user'});
116+
}
117+
return done(null, user);
118+
});
119+
}));
120+
99121
## License
100122

101123
[The MIT License](http://opensource.org/licenses/MIT)

0 commit comments

Comments
 (0)