# express-social-middleware

> Middleware OAuth2.0 for Google and Facebook.

Latest version **0.0.3** (published 2019-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install express-social-middleware
pnpm add express-social-middleware
yarn add express-social-middleware
bun add express-social-middleware
```

## 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.0.3 |
| Published | 2019-01-25 |
| First published | 2019-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Fabio Garcia Balbuena |
| Maintainers | fagarbal |
| Keywords | google, facebook, middleware, express, oauth, passport |

## Links

- npm: https://www.npmjs.com/package/express-social-middleware
- Repository: https://github.com/omnea/express-social-middleware
- Homepage: https://github.com/omnea/express-social-middleware#readme
- Issues: https://github.com/omnea/express-social-middleware/issues
- npm.io page: https://npm.io/package/express-social-middleware

## Dependencies (5)

- [express](https://npm.io/package/express.md) ^4.16.4
- [passport](https://npm.io/package/passport.md) ^0.4.0
- [build-url](https://npm.io/package/build-url.md) ^1.3.2
- [passport-facebook](https://npm.io/package/passport-facebook.md) ^3.0.0
- [passport-google-oauth20](https://npm.io/package/passport-google-oauth20.md) ^1.0.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@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

## Recent versions

- 0.0.3 (latest) — 2019-01-25
- 0.0.2 — 2019-01-25
- 0.0.1 — 2019-01-25

## README

# express-social-middleware

## Description

- Express Middleware for connecting to Facebook and Google.

```javascript
    const expressSocialMiddleware = require('express-social-middleware');

    ...

    app.use('/', expressSocialMiddleware({
        google: {
            clientID: GOOGLE_CLIENT_ID,
            clientSecret: GOOGLE_CLIENT_SECRET,
            callbackURL: GOOGLE_CALLBACK,
        },
        facebook: {
            clientID: FACEBOOK_CLIENT_ID,
            clientSecret: FACEBOOK_CLIENT_SECRET,
            callbackURL: FACEBOOK_CALLBACK,
        }
    }));
```

## Install

```bash
    $ npm install --save express-social-middleware
```

## Endpoints

**/google**
**/facebook**
- query parameters:
    - url: final redirection url.
        - path: extra url information.
        - ...other: You can add some extra query parameters.
        
**/google/callback**
**/facebook/callback**
- it will redirect automaticaly to the url set on the first call with the refreshToken/accessToken included.

## Examples

1. **/google?url=https://someurl.com&bar=123&baz=abc**

    generates -> https://someurl.com?bar=123&baz=abc&refreshToken=XXXXX

2. **/google?url=https://someurl.com&path=/section/123&bar=123&baz=abc**

    generates -> https://someurl.com/#/section/123?bar=123&baz=abc&refreshToken=XXXXX

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