# passport-singly

> Singly authentication strategy for Passport.

Latest version **0.1.1** (published 2012-11-20) · 0 weekly downloads

## Install

```sh
npm install passport-singly
pnpm add passport-singly
yarn add passport-singly
bun add passport-singly
```

## 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.1 |
| Published | 2012-11-20 |
| First published | 2012-11-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Beau Gunderson |
| Maintainers | johnnyhalife, beaugunderson |
| Keywords | passport, singly, auth, authn, authentication, identity |

## Links

- npm: https://www.npmjs.com/package/passport-singly
- Repository: https://github.com/Singly/passport-singly
- Issues: http://github.com/Singly/passport-singly/issues
- npm.io page: https://npm.io/package/passport-singly

## Dependencies (2)

- [pkginfo](https://npm.io/package/pkginfo.md) 0.2.x
- [passport-oauth](https://npm.io/package/passport-oauth.md) ~0.1.12

## 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.1 (latest) — 2012-11-20
- 0.1.0 — 2012-11-08
- 0.0.31 — 2012-11-07
- 0.0.3 — 2012-11-07
- 0.0.2 — 2012-11-06

## README

# Passport-Singly

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

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

## Usage

#### Configure Strategy

The Singly authentication strategy authenticates users using a Singly
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 app ID, app secret, and callback URL.

    passport.use(new SinglyStrategy({
        clientID: SINGLY_APP_ID,
        clientSecret: SINGLY_APP_SECRET,
        callbackURL: "http://localhost:3000/auth/singly/callback"
      },
      function(accessToken, refreshToken, profile, done) {
        User.findOrCreate({ singlyId: profile.id }, function (err, user) {
          return done(err, user);
        });
      }
    ));

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'singly'` strategy, to
authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application (not that the ordering of these two routes is important):

    app.get('/auth/singly/callback', passport.authenticate('singly', {
      failureRedirect: '/login',
      successReturnToOrRedirect: '/'
    }));

    app.get('/auth/singly/:service', passport.authenticate('singly'));

#### Extended Permissions

If you need extended permissions from the user, the permissions can be requested
via the `scope` option to `passport.authenticate()`.

For example, this authorization specifies Facebook as the service and requests
permission to the user's statuses and checkins:

    app.get('/auth/singly', passport.authenticate('singly', {
      service: 'facebook',
      scope: ['user_status', 'user_checkins']
    }));

## Examples

For a complete, working example, refer to the [login example](https://github.com/Singly/passport-singly/tree/master/examples/login).

## Tests

    $ npm install --dev
    $ make test

[![Build Status](https://secure.travis-ci.org/Singly/passport-singly.png)](http://travis-ci.org/Singly/passport-singly)

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