
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
hopjs-oauth
Advanced tools
This is the oauth plugin for Hop.js (http://github.com/celer/hopjs)
To use this plugin simply use it like so
var Hop = require('hopjs');
Hop.use(require('hopjs-oauth'));
//This function when provided with a user object will return the id of the user
var getUserId=function(){ ...}
var provider = Hop.useOAuth({
crypt_key:"foo",
sign_key:"bar",
loginURL: "/login",
grantStore: new Hop.RedisGrantStore({ redisClient: redisClient, getUserId: getUserId }),
accessToken:function(req,token,next){
console.log("Access token request",token);
loadUserById(token.user_id, function(err,user){
if(user){
req.session.user=user;
next();
} else {
next(new Error("Unable to load user"));
}
});
}
});
var app = express();
app.configure(function(){
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser('your secret here'));
app.use(express.session());
app.use(provider.oauth());
app.use(provider.login());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
});
See http://github.com/celer/hopjs-oauth/tree/master/examples/provider and http://github.com/celer/hopjs-oauth/tree/master/examples/consumer for working examples
FAQs
OAuth2 provider support for hopjs
The npm package hopjs-oauth receives a total of 5 weekly downloads. As such, hopjs-oauth popularity was classified as not popular.
We found that hopjs-oauth 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.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.