# ml-passport-qq

> qq authentication strategy for Passport.

Latest version **0.0.1** (published 2017-09-20) · 0 weekly downloads

## Install

```sh
npm install ml-passport-qq
pnpm add ml-passport-qq
yarn add ml-passport-qq
bun add ml-passport-qq
```

## 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.1 |
| Published | 2017-09-20 |
| First published | 2017-09-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | melonrubyhaha |
| Keywords | passport, qq, auth, authn, authentication, identity |

## Links

- npm: https://www.npmjs.com/package/ml-passport-qq
- npm.io page: https://npm.io/package/ml-passport-qq

## Dependencies (2)

- [pkginfo](https://npm.io/package/pkginfo.md) 0.2.x
- [passport-oauth](https://npm.io/package/passport-oauth.md) 0.1.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.0.1 (latest) — 2017-09-20

## README

# Passport-qq


[Passport](http://passportjs.org/) strategy for authenticating with [qq](http://qq.com/)
using the OAuth 2.0 API.

This module lets you authenticate using qq in your Node.js applications.
By plugging into Passport, qq 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/).

## Installation

    $ npm install passport-qq

## Usage

#### Configure Strategy

The qq authentication strategy authenticates users using a qq 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 client ID, client secret, and callback URL.

    passport.use(new qqStrategy({
        clientID: client_id,
        clientSecret: client_secret,
        callbackURL: "http://127.0.0.1:3000/auth/qq/callback"
      },
      function(accessToken, refreshToken, profile, done) {
        User.findOrCreate({ qqId: profile.id }, function (err, user) {
          return done(err, user);
        });
      }
    ));

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'qq'` strategy, to
authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

    app.get('/auth/qq',
      passport.authenticate('qq'),
      function(req, res){
        // The request will be redirected to qq for authentication, so this
        // function will not be called.
      });

    app.get('/auth/qq/callback',
      passport.authenticate('qq', { failureRedirect: '/login' }),
      function(req, res) {
        // Successful authentication, redirect home.
        res.redirect('/');
      });

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