![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@harvard-library/passport-cas2-strategy-dev
Advanced tools
A CAS2 authentication strategy for [PassportJS](http://www.passportjs.org/) authentication middleware. This code was written based on the code in the [passport-cas](https://github.com/sadne/passport-cas) module and has been adapted specifically for Harvar
A CAS2 authentication strategy for PassportJS authentication middleware. This code was written based on the code in the passport-cas module and has been adapted specifically for Harvard Library.
$ npm install @harvard-library/passport-cas2-strategy
const passport = require('passport');
const Cas2Strategy = require('@harvard-library/passport-cas2-strategy').Strategy;
passport.use(new Cas2Strategy({
ssoBaseUrl: process.env.CAS_SSO_BASE_URL,
ssoLoginUrl: process.env.CAS_SSO_LOGIN_URL,
validateEndpoint: process.env.CAS_VALIDATE_ENDPOINT,
appServiceUrl: process.env.CAS_APP_SERVICE_URL
}, (user, done) => {
let email, eppn;
// Check if all required user object properites were returned by the CAS server
if (!user || !user.mail) {
done(`Missing required user properties from the authentication server.`);
return null;
} else {
email = user.mail;
}
// Check if email address exists in database here...
console.log(`Authentication completed successfully ${email}`);
// Return user object properties
const payload = {
EmailAddress: email,
};
done(null, payload);
return null;
}
));
// GET: '/cas_login'
exports.casLogin = function(req, res, next) {
passport.authenticate('cas2', function (err, user, info) {
// Authentication strategy callback
console.log(`passport.authenticate ${user} ${info}`);
// Check error
if (err) {
console.error(err);
return res.status(500).json(err);
}
/* AUTHENTICATION FAILED */
// Check if user empty
if (!user) {
const message = info ? info : `Authentication failed`;
// Render server side unauthorized page with error message
return res.status(401).render('unauthorized', {
error: true,
errorMsg: message
});
}
/* AUTHENTICATION SUCCESS */
// Create session or generate JWT token here...
// Redirect
return res.redirect(200, '/');
})(req, res, next);
}
FAQs
A CAS2 authentication strategy for [PassportJS](http://www.passportjs.org/) authentication middleware. This code was written based on the code in the [passport-cas](https://github.com/sadne/passport-cas) module and has been adapted specifically for Harvar
The npm package @harvard-library/passport-cas2-strategy-dev receives a total of 4 weekly downloads. As such, @harvard-library/passport-cas2-strategy-dev popularity was classified as not popular.
We found that @harvard-library/passport-cas2-strategy-dev demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.