
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.
Third-party authentication plugin for hapi.
Lead Maintainer: Adri Van Houdt
bell ships with built-in support for authentication using Facebook
, GitHub
, Google
,
Google Plus
, Instagram
, LinkedIn
, Slack
, Stripe
, Twitter
, Yahoo
, Foursquare
,
VK
, ArcGIS Online
, Windows Live
, Nest
, Phabricator
, BitBucket
, Dropbox
, Reddit
,
Tumblr
, Twitch
, Mixer
, Salesforce
, Pinterest
, Discord
, DigitalOcean
, AzureAD
,
trakt.tv
and Okta
.
It also supports any compliant OAuth 1.0a
and OAuth 2.0
based login services with a simple
configuration object.
Social Login with Twitter using hapi.js
Twitter:
// Load modules
const Bell = require('bell');
const Hapi = require('hapi');
// Declare internals
const internals = {};
internals.start = async function () {
const server = Hapi.server({ port: 8000 });
// Register bell with the server
await server.register(Bell);
// Declare an authentication strategy using the bell scheme
// with the name of the provider, cookie encryption password,
// and the OAuth client credentials.
server.auth.strategy('twitter', 'bell', {
provider: 'twitter',
password: 'cookie_encryption_password_secure',
clientId: 'my_twitter_client_id',
clientSecret: 'my_twitter_client_secret',
isSecure: false // Terrible idea but required if not using HTTPS especially if developing locally
});
// Use the 'twitter' authentication strategy to protect the
// endpoint handling the incoming authentication credentials.
// This endpoint usually looks up the third party account in
// the database and sets some application state (cookie) with
// the local application account information.
server.route({
method: ['GET', 'POST'], // Must handle both GET and POST
path: '/login', // The callback endpoint registered with the provider
options: {
auth: 'twitter',
handler: function (request, h) {
if (!request.auth.isAuthenticated) {
return `Authentication failed due to: ${request.auth.error.message}`;
}
// Perform any account lookup or registration, setup local session,
// and redirect to the application. The third-party credentials are
// stored in request.auth.credentials. Any query parameters from
// the initial request are passed back via request.auth.credentials.query.
return h.redirect('/home');
}
}
});
await server.start();
};
internals.start();
FAQs
Third-party login plugin for hapi
The npm package bell receives a total of 877 weekly downloads. As such, bell popularity was classified as not popular.
We found that bell demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.