Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
passport-oauth2-oidc
Advanced tools
OAuth2 + OpenID Connect (OIDC) authentication strategy for Passport.
This is a fork of passport-openidconnect (the original project seems unmaintained).
The goal is to have a unified passport strategy for OAuth2 and OpenID Connect (OIDC), as OIDC is an identity layer built on top of OAuth2.
npm install passport-oauth2-oidc
or
yarn add passport-oauth2-oidc
Here's a minimal working example:
const express = require('express');
const app = express();
const passport = require('passport');
const OIDCStrategy = require('passport-oauth2-oidc').Strategy;
passport.use(new OIDCStrategy({
passReqToCallback: true,
issuer: 'https://api.mpin.io',
authorizationURL: 'https://api.mpin.io/authorize',
tokenURL: 'https://api.mpin.io/oidc/token',
userInfoURL: 'https://api.mpin.io/oidc/userinfo',
scope: 'openid profile email email_verified',
clientID: '...',
clientSecret: '...',
callbackURL: '/auth/miracl/callback',
}));
const auth = passport.authenticate('oauth2-oidc', function(req, iss, sub, profile, done) {
return done(null, profile);
});
app.get('/', auth, (req, res) => {
res.send(`Hello ${req.user.email}!`)
});
const port = 3000;
app.listen(port, () => {
console.log(`Ready: http://localhost:${port}/`)
});
FAQs
OAuth2 + OpenID Connect (OIDC) authentication strategy for Passport.
We found that passport-oauth2-oidc 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.