Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
passport-oauth2-client-password
Advanced tools
OAuth 2.0 client password authentication strategy for Passport.
OAuth 2.0 client password authentication strategy for Passport.
This module lets you authenticate requests containing client credentials in the request body, as defined by the OAuth 2.0 specification. These credentials are typically used protect the token endpoint and used as an alternative to HTTP Basic authentication.
$ npm install passport-oauth2-client-password
The OAuth 2.0 client password authentication strategy authenticates clients
using a client ID and client secret. The strategy requires a verify
callback,
which accepts those credentials and calls done
providing a client.
passport.use(new ClientPasswordStrategy(
function(clientId, clientSecret, done) {
Clients.findOne({ clientId: clientId }, function (err, client) {
if (err) { return done(err); }
if (!client) { return done(null, false); }
if (client.clientSecret != clientSecret) { return done(null, false); }
return done(null, client);
});
}
));
Use passport.authenticate()
, specifying the 'oauth2-client-password'
strategy, to authenticate requests. This strategy is typically used in
combination with HTTP Basic authentication (as provided by passport-http),
allowing clients to include credentials in the request body.
For example, as route middleware in an Express application, using OAuth2orize middleware to implement the token endpoint:
app.get('/profile',
passport.authenticate(['basic', 'oauth2-client-password'], { session: false }),
oauth2orize.token());
The example
included with OAuth2orize
demonstrates how to implement a complete OAuth 2.0 authorization server.
ClientPasswordStrategy
is used to authenticate clients as they request access
tokens from the token endpoint.
$ npm install --dev
$ make test
Copyright (c) 2012-2013 Jared Hanson <http://jaredhanson.net/>
FAQs
OAuth 2.0 client password authentication strategy for Passport.
The npm package passport-oauth2-client-password receives a total of 37,903 weekly downloads. As such, passport-oauth2-client-password popularity was classified as popular.
We found that passport-oauth2-client-password 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.