Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
passport-openid-oauth20
Advanced tools
Readme
Passport strategy for authenticating with OpenID providers using the OAuth 2.0 API.
npm install passport-openid-oauth20
The strategy requires a verify
callback, which receives the access token and optional
refresh token, as well as profile
which contains the authenticated user's
OpenID profile. The verify
callback must call cb
providing a user to
complete authentication.
var OpenIdOAuth2Strategy = require("passport-openid-oauth20").Strategy;
// Example using Google OpenID profile.
passport.use(
"google",
new OpenIdOAuth2Strategy(
{
authorizationURL: "https://accounts.google.com/o/oauth2/v2/auth",
tokenURL: "https://www.googleapis.com/oauth2/v4/token",
userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo",
clientID: GOOGLE_CLIENT_ID,
clientSecret: GOOGLE_CLIENT_SECRET,
callbackURL: "https://www.example.net/auth/google/callback"
},
function(accessToken, refreshToken, profile, cb) {
User.findOrCreate(
{ providerId: profile.id, provider: profile.provider },
function(err, user) {
return cb(err, user);
}
);
}
)
);
Use passport.authenticate()
, specifying the strategy name, or 'openid-oauth20'
, to
authenticate requests.
For example, as route middleware in an Express application:
app.get(
"/auth/google",
passport.authenticate("google", { scope: ["profile"] })
);
app.get(
"/auth/google/callback",
passport.authenticate("google", { failureRedirect: "/login" }),
function(req, res) {
// Successful authentication, redirect home.
res.redirect("/");
}
);
Copyright (c) 2019 Christophe Querton <https://kertof.com/>
FAQs
OAuth 2.0 authentication strategy for OpenID profiles for Passport.
The npm package passport-openid-oauth20 receives a total of 530 weekly downloads. As such, passport-openid-oauth20 popularity was classified as not popular.
We found that passport-openid-oauth20 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.