# i3po-passport-yahoo-oauth2

> OAuth 2.0 Strategy for Yahoo!

Latest version **0.1.3** (published 2018-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install i3po-passport-yahoo-oauth2
pnpm add i3po-passport-yahoo-oauth2
yarn add i3po-passport-yahoo-oauth2
bun add i3po-passport-yahoo-oauth2
```

## 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.3 |
| Published | 2018-02-06 |
| First published | 2018-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexey Chernov |
| Maintainers | i3po |
| Keywords | passport, yahoo, oauth2, auth |

## Links

- npm: https://www.npmjs.com/package/i3po-passport-yahoo-oauth2
- npm.io page: https://npm.io/package/i3po-passport-yahoo-oauth2

## Dependencies (3)

- [pkginfo](https://npm.io/package/pkginfo.md) ^0.4.1
- [utils-merge](https://npm.io/package/utils-merge.md) ^1.0.1
- [passport-oauth2](https://npm.io/package/passport-oauth2.md) 1.x.x

## 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.1.3 (latest) — 2018-02-06

## README

# Passport-Yahoo-OAuth2

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

This module lets you authenticate using Yahoo in your Node.js applications.
By plugging into Passport, Yahoo 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/).

## Usage

### Configure Strategy

The Yahoo authentication strategy authenticates users using a Yahoo 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 YahooOAuth2Strategy({
        clientID: YAHOO_CLIENT_ID,
        clientSecret: YAHOO_CLIENT_SECRET,
        callbackURL: "https://www.example.net/auth/Yahoo-oauth2/callback",
        redirectParams: {
            existingUserId: '12345',
            otherToken: OTHER_TOKEN
        }
      },
      function(accessToken, refreshToken, params, profile, done) {
        User.findOrCreate({ providerId: profile.id }, function (err, user) {
          return done(err, user);
        });
      }
    ));

### Authenticate Requests

Use `passport.authenticate()`, specifying the `'yahoo-oauth2'` strategy, to
authenticate requests.

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

    app.get('/auth/yahoo',
      passport.authenticate('yahoo-oauth2'));

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

## Examples

Examples not yet provided

## Tests

Tests not yet provided

## Prior work

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

Copyright (c) 2017 Mike Lee

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