Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
cantina-auth-facebook
Advanced tools
Facebook authentication for Cantina.
authURL
route.Defaults
{
'auth-facebook': {
successRedirect: '/',
failureRedirect: '/',
authURL: '/login'
}
}
Your application MUST provide handlers for serializing, deserializing, and verifying users.
app.serializeUser
app.deserializeUser
app.verifyFacebookUser
var app = require('cantina').createApp();
app.boot(function(err) {
if (err) return console.error(err);
app.conf.add({
'auth-facebook': {
clientID: 'your id here',
clientSecret: 'your secret here',
callbackURL: 'http://mydomain.com/auth/facebook/callback',
authURL: '/login/facebook',
scope: 'email'
}
});
app.serializeUser = function(user, cb) {
return cb(null, user);
};
app.deserializeUser = function(obj, cb) {
return cb(null, obj);
};
app.verifyFacebookUser = function(token, tokenSecret, profile, done) {
return done(null, profile);
};
app.require('cantina-web');
app.require('cantina-redis');
app.require('cantina-session');
app.require('cantina-auth');
app.require('cantina-auth-facebook');
app.start(function(err) {
if (err) return console.error(err);
app.middleware.get('/', function index(req, res) {
res.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'});
if (req.isAuthenticated()) {
res.end('Welcome, <a href="https://facebook.com/' + req.user.username + '">' + req.user.displayName + '</a>!');
}
else {
res.end('<a href="/login/facebook">click here to login via Facebook</a>');
}
});
});
});
Terra Eclipse, Inc. is a nationally recognized political technology and strategy firm located in Santa Cruz, CA and Washington, D.C.
FAQs
Facebook authentication for cantina
The npm package cantina-auth-facebook receives a total of 2 weekly downloads. As such, cantina-auth-facebook popularity was classified as not popular.
We found that cantina-auth-facebook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.