
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-auth0
Advanced tools
This is the auth0 authentication strategy for Passport.js.
npm install passport-auth0
Take your credentials from the settings section in the dashboard and initialize the strategy as follows:
var Auth0Strategy = require('passport-auth0'),
passport = require('passport');
var strategy = new Auth0Strategy({
domain: 'your-domain.auth0.com',
clientID: 'your-client-id',
clientSecret: 'your-client-secret',
callbackURL: '/callback'
},
function(accessToken, idToken, profile, done) {
//do something here with the profile
return done(null, profile);
}
);
passport.use(strategy);
app.get('/callback',
passport.authenticate('auth0', { failureRedirect: '/login' }),
function(req, res) {
if (!req.user) {
throw new Error('user null');
}
res.redirect("/");
}
);
app.get('/login',
passport.authenticate('auth0', {}), function (req, res) {
res.redirect("/");
});
This way when you go to /login
you will get redirect to auth0, to a page where you can select the identity provider.
If you want to force to force an identity provider you can use:
app.get('/login/google',
passport.authenticate('auth0', {connection: 'google-oauth2'}), function (req, res) {
res.redirect("/");
});
If you want to get a list of connections or users from auth0, use the auth0 module.
A complete example of using this library here.
For more information about auth0 contact our documentation page.
This client library is MIT licensed.
FAQs
Auth0 platform authentication strategy for Passport.js
The npm package passport-auth0 receives a total of 92,155 weekly downloads. As such, passport-auth0 popularity was classified as popular.
We found that passport-auth0 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 44 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.
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.