# passport-line-token

> Line token authentication strategy for Passport

Latest version **1.0.1** (published 2019-03-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install passport-line-token
pnpm add passport-line-token
yarn add passport-line-token
bun add passport-line-token
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-03-08 |
| First published | 2018-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ray Lin |
| Maintainers | ray0427 |
| Keywords | passport, line, auth, oauth2 |

## Links

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

## Dependencies (1)

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

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-03-08
- 1.0.0 — 2018-08-19

## README

# passport-line-token
Passport strategy for authenticating with Line access tokens using the OAuth 2.0 API.
Based on [Line Social API v2.1](https://developers.line.me/en/docs/social-api/)
## Installation

    $ npm install --save passport-line-token

## Usage
### Configure Strategy
```js
var LineTokenStrategy = require('passport-line-token');

passport.use(new LineTokenStrategy({
    clientID: LINE_CHANNEL_ID,
    clientSecret: LINE_CHANNEL_SECRET,
  }, function(accessToken, refreshToken, profile, done) {
    User.findOrCreate({lineId: profile.id}, function (error, user) {
      return done(error, user);
    });
  }
));
```

### Authenticate Requests

Use `passport.authenticate()`, specifying the `'line-token'` strategy, to authenticate requests.

```js
app.post('/auth/line/token',
  passport.authenticate('line-token'),
  function (req, res) {
    // do something with req.user
    res.send(req.user? 200 : 401);
  }
);
```


## Reference

- [passport-facebook-token](https://github.com/drudge/passport-facebook-token)
- [passport-line-auth](https://github.com/IvanWei/passport-line-auth) passport line strategy for web server
- [Line Socail Api](https://developers.line.me/en/docs/social-api/)

## License
[The MIT License](https://github.com/Ray0427/passport-line-token/blob/master/LICENSE)

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