# @feathersjs/authentication-oauth2

> An OAuth2 authentication strategy for feathers-authentication using Passport

Latest version **1.3.1** (published 2019-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @feathersjs/authentication-oauth2
pnpm add @feathersjs/authentication-oauth2
yarn add @feathersjs/authentication-oauth2
bun add @feathersjs/authentication-oauth2
```

## Health

**Score 43/100 (D)** — status: abandoned.

Positive: has types package; no vulnerabilities; high maintenance score; high quality score; popular repo.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2019-01-26 |
| First published | 2017-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/feathersjs__authentication-oauth2) |
| Module format | CommonJS |
| Node | >= 6 |
| Dependencies | 5 |
| Unpacked size | 31.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 15257 |
| Author | Feathers contributors |
| Maintainers | corymsmith, daffl, ekryski, marshallswain |
| Keywords | feathers, feathers-plugin |

## Links

- npm: https://www.npmjs.com/package/@feathersjs/authentication-oauth2
- Repository: https://github.com/feathersjs/feathers
- Homepage: https://feathersjs.com
- Issues: https://github.com/feathersjs/feathers/issues
- npm.io page: https://npm.io/package/@feathersjs/authentication-oauth2

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^4.0.0
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.1
- [@feathersjs/errors](https://npm.io/package/@feathersjs/errors.md) ^3.3.6
- [@feathersjs/commons](https://npm.io/package/@feathersjs/commons.md) ^4.0.0
- [@feathersjs/express](https://npm.io/package/@feathersjs/express.md) ^1.3.1

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2019-01-26
- 1.0.0-pre.1 (pre) — 2017-10-25
- 1.3.0 — 2019-01-06
- 1.2.7 — 2019-01-02
- 1.2.6 — 2018-12-16
- 1.2.5 — 2018-10-25
- 1.2.4 — 2018-09-21
- 1.2.3 — 2018-09-17
- 1.2.2 — 2018-09-02
- 1.2.1 — 2018-08-30
- 1.2.0 — 2018-08-28
- 1.1.0 — 2018-06-23
- 1.0.3 — 2018-01-03
- 1.0.2 — 2017-11-28
- 1.0.1 — 2017-11-16
- … 1 more at https://npm.io/package/@feathersjs/authentication-oauth2/versions

## README

# @feathersjs/authentication-oauth2

[![Build Status](https://travis-ci.org/feathersjs/feathers.png?branch=master)](https://travis-ci.org/feathersjs/feathers)
[![Dependency Status](https://img.shields.io/david/feathersjs/feathers.svg?style=flat-square&path=packages/authentication-oauth2)](https://david-dm.org/feathersjs/feathers?path=packages/authentication-oauth2)
[![Download Status](https://img.shields.io/npm/dm/@feathersjs/authentication-oauth2.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/authentication-oauth2)

> An OAuth2 authentication strategy for feathers-authentication using Passport

## Installation

```
npm install @feathersjs/authentication-oauth2 --save
```

**Note:** This is only compatibile with `feathers-authentication@1.x` and above.

## Quick example

```js
const feathers = require('@feathersjs/feathers');
const authentication = require('feathers-authentication');
const jwt = require('feathers-authentication-jwt');
const oauth2 = require('@feathersjs/authentication-oauth2');
const FacebookStrategy = require('passport-facebook').Strategy;
const app = feathers();

// Setup authentication
app.configure(authentication(settings));
app.configure(jwt());
app.configure(oauth2({
  name: 'facebook',
  Strategy: FacebookStrategy,
  clientID: '<your client id>',
  clientSecret: '<your client secret>',
  scope: ['public_profile', 'email']
}));

// Setup a hook to only allow valid JWTs to authenticate
// and get new JWT access tokens
app.service('authentication').hooks({
  before: {
    create: [
      authentication.hooks.authenticate(['jwt'])
    ]
  }
});
```

## Documentation

Please refer to the [@feathersjs/authentication-oauth2 API documentation](https://docs.feathersjs.com/api/authentication/oauth2.html) for more details.

## License

Copyright (c) 2018

Licensed under the [MIT license](LICENSE).

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