
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
passport-slack-ponycode
Advanced tools
Passport strategy for authenticating with Slack using the OAuth 2.0 API.
This module lets you authenticate using Slack in your Node.js applications. By plugging into Passport, Slack authentication can be easily integrated into any application or framework that supports Connect-style middleware, including Express.
$ npm install passport-slack-ponycode
The Slack authentication strategy authenticates users using a Slack account
and OAuth tokens. The strategy requires a verify
callback, which receives the
access token and corresponding secret as arguments, as well as user
which
contains the authenticated user's slack info. The verify
callback must
call done
providing a user to complete authentication.
In order to identify your application to Slack, specify the clientID,
clientSecret, and redirect URL within options
. The client ID and secret
are obtained by creating an application at
Slacks's api site.
var SlackStrategy = require('./passport-slack').SlackStrategy;
passport.use( 'slack', new SlackStrategy({
clientID: "[slack client id]",
clientSecret:"[slack client secret]",
callbackURL: "[host]/authenticate/callback",
slackTeam: "[optional slack team id to force joining a team]"
}, function( token, tokenSecret, profile, done ){
// This is your chance to find a User in your database.
var User = neoteric.model('User');
User.findBySlackId( profile.id, function( error, existingUser ){
if( error ) return done( error, false );
if( existingUser ){
done( error, existingUser );
}else{
var newUser = new User();
newUser.username = parsedBody.user;
newUser.slackId = slackId;
newUser.save( function( error, newUser ){
done( error, newUser );
});
}
});
}));
Use passport.authenticate()
, specifying the 'slack'
strategy, to
authenticate requests.
For example, as route middleware in an Express application:
app.get('/auth/slack',
passport.authenticate('slack'));
app.get('/auth/slack/callback',
passport.authenticate('slack', { failureRedirect: '/login' }),
function(req, res) {
// Successful authentication, redirect home.
res.redirect('/');
});
Copyright (c) 2014 Josh Kennedy <http://ponycode.com/>
FAQs
Slack authentication strategy for Passport.
We found that passport-slack-ponycode 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
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.