# passport-legalshield

> Passport strategy to authenticate against Legalshield's OAuth2 implementation

Latest version **0.1.1** (published 2018-02-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install passport-legalshield
pnpm add passport-legalshield
yarn add passport-legalshield
bun add passport-legalshield
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2018-02-03 |
| First published | 2016-09-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 6.6.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jonathon Storer |
| Maintainers | yonafin |

## Links

- npm: https://www.npmjs.com/package/passport-legalshield
- Repository: https://github.com/LegalShield/passport-legalshield
- Homepage: https://github.com/LegalShield/passport-legalshield#readme
- Issues: https://github.com/LegalShield/passport-legalshield/issues
- npm.io page: https://npm.io/package/passport-legalshield

## Dependencies (2)

- [pkginfo](https://npm.io/package/pkginfo.md) ^0.4.0
- [passport-oauth](https://npm.io/package/passport-oauth.md) ^1.0.0

## Recent versions

- 0.1.1 (latest) — 2018-02-03
- 0.1.0 — 2016-10-24
- 0.0.2 — 2016-09-30

## README

# passport-legalshield

[Passport](http://passportjs.org/) strategy for authenticating with [LegalShield](https://legalshield.com/)
using the OAuth 2.0 API.

This module lets you authenticate using LegalShield in your Node.js applications.
By plugging into Passport, LegalShield authentication can be easily and
unobtrusively integrated into any application or framework that supports
[Connect](http://www.senchalabs.org/connect/)-style middleware, including
[Express](http://expressjs.com/).

## Install
    $ npm install passport-legalshield

## Usage
### Configure Strategy

The LegalShield authentication strategy authenticates users using a LegalShield account
and OAuth 2.0 tokens.  The strategy requires a `verify` callback, which accepts
these credentials and calls `done` providing a user, as well as `options`
specifying a API version, client ID, client secret, and callback URL.

    passport.use(new LegalShieldAuthStrategy({
        clientID: LEGALSHIELD_CLIENT_ID,
        clientSecret: LEGALSHIElD_CLIENT_SECRET,
        callbackURL: "https://www.example.net/auth/legalshield/callback"
      },
      function(accessToken, refreshToken, profile, done) {
        User.findOrCreate({ providerId: profile.id }, function (err, user) {
          return done(err, user);
        });
      }
    ));

### Authenticate Requests
Use `passport.authenticate()`, specifying the `'legalshield'` strategy, to
authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

    app.get('/auth/legalshield',
      passport.authenticate('legalshield'));

    app.get('/auth/legalshield/callback', 
      passport.authenticate('legalshield', { failureRedirect: '/login' }),
      function(req, res) {
        // Successful authentication, redirect home.
        res.redirect('/');
      });

## Examples
Examples not yet provided

## Tests
`npm test`


## Prior work
This strategy is based on Jared Hanson's GitHub strategy for passport: [Jared Hanson](http://github.com/jaredhanson)

---
_Source: https://npm.io/package/passport-legalshield · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
