Skip to content

Commit

Permalink
chore: migrate passport-apereo-cas to @coursetable/passport-cas (requ…
Browse files Browse the repository at this point in the history
…ires "npm install")

passport-apereo-cas has not been maintained for 5 years.

While https://github.com/coursetable/passport-cas is updated from time to time by serious contributors (https://github.com/hsheth2 : the main contributor to https://github.com/datahub-project/datahub . And https://github.com/Josh-Cena : the second main contributor to https://github.com/mdn/content and https://github.com/facebook/docusaurus )
  • Loading branch information
floriannari committed Oct 21, 2024
1 parent f824fe2 commit ad36b28
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 120 deletions.
169 changes: 55 additions & 114 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"start": "node run"
},
"dependencies": {
"@coursetable/passport-cas": "0.1.x",
"body-parser": "2.x",
"cookie-parser": "1.x",
"debug": "4.x",
Expand All @@ -21,7 +22,6 @@
"materialize-css": "0.97.x",
"morgan": "1.x",
"passport": "0.7.x",
"passport-apereo-cas": "0.2.0",
"pug": "3.x",
"serve-favicon": "2.x",
"socket.io": "4.x",
Expand All @@ -34,10 +34,6 @@
"express-socket.io-session": {
"cookie-parser": ">=1.4.7"
},
"passport-apereo-cas": {
"axios": "0.x",
"xml2js": "0.x"
},
"materialize-css": {
"jquery": "3.x",
"node-archiver": "npm:dry-uninstall"
Expand Down
8 changes: 7 additions & 1 deletion server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ module.exports = function(_passport) {
CAS.casBaseURL += "/";
}

passport.use(new(require('passport-apereo-cas').Strategy)(CAS, function(profile, done) {
const passportCasOpts = {
version: CAS.version,
ssoBaseURL: CAS.casBaseURL,
serverBaseURL: CAS.serviceBaseURL,
}

passport.use(new(require('@coursetable/passport-cas').Strategy)(passportCasOpts, function(profile, done) {
// console.log("profile : " + JSON.stringify(profile, null ,2));
return done(null, {uid:profile.user, attributes:profile.attributes});
}));
Expand Down

0 comments on commit ad36b28

Please sign in to comment.