npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pplsi/passport-pplsi

v3.0.3

Published

Passport strategies to authenticate against PPLSI.

Readme

Codeship Status for LegalShield/passport-pplsi

Passport PPLSI

A collection of passport strategies for authenticating against PPLSI.

These modules let you authenticate using PPLSI in your Node.js applications. By plugging into Passport, PPLSI authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Install

$ npm install @pplsi/passport-pplsi

Current Strategies

OAuth2

PasswordStrategy

Configure Strategy

The PPLSI OAuth2 Password authentication strategy authenticates users using a PPLSI account and the OAuth 2.0 password grant flow. The strategy requires a base URL for the PPLSI authentication server and your PPLSI client ID to be passed in.

const PasswordStrategy = require('@pplsi/passport-pplsi').OAuth2.PasswordStrategy;

passport.use(new PasswordStrategy({
  base_url: 'https://api.legalshield.com',
  client_id: some-client-id
}));

You can optionally pass in the scope to use when making the token request. By default the scope is openid. This will return the id_token but if you want to include claims with that token you will need to pass in the claims that you want in the scope. So if you wanted additional claims you would include them in the options like so:

const PasswordStrategy = require('@pplsi/passport-pplsi').OAuth2.PasswordStrategy;

passport.use(new PasswordStrategy({
  base_url: 'https://api.legalshield.com',
  client_id: some-client-id,
  scope: 'openid name roles'
}));

Authenticate Requests

Use passport.authenticate(), specifying the 'pplsi-oauth2-password' strategy, to authenticate requests.

For example, as a route middleware in an Express application:

app.post('/login', passport.authenticate('pplsi-oauth2-password', function(req, res) {
  res.send(req.session.passport.user);
});

AuthorizationCodeStrategy

Configure Strategy

The PPLSI OAuth2 Authorization Code authentication strategy authenticates users using a PPLSI account and the OAuth 2.0 authorization code grant flow. The strategy requires the base URL for the PPLSI authentication server, your PPLSI client ID, your PPLSI client secret, and your applications redirect URI to be passed in.

const AuthorizationCodeStrategy = require('@pplsi/passport-pplsi').OAuth2.AuthorizationCodeStrategy;

passport.use('pplsi-oauth2-authorization-code', new AuthorizationCodeStrategy({
  base_url: 'https://api.legalshield.com',
  client_id: some-client-id,
  client_secret: some-client-secret,
  redirect_uri: 'https://example.com/callback'
}));

Authenticate Requests

Use passport.authenticate(), specifying the 'pplsi-oauth2-authorization-code' strategy, to authenticate requests. You will also need to pass in the request query as the second parameter to authenticate with google or facebook.

For example, as a route middleware in an Express application:

app.get('/auth/pplsi', function(req, res, next) {
  passport.authenticate('pplsi-oauth2-authorization-code', req.query || {})(req, res, next);
});

app.get('/auth/pplsi/callback', passport.authenticate('pplsi-oauth2-authorization-code', { failureRedirect: '/error', successRedirect: '/home' }));

Tests

npm test

Prior Work

This strategy is based on Jared Hanson's GitHub strategy for passport: Jared Hanson