# socket.io-passport

> Passport middleware for Socket.IO

Latest version **0.1.1** (published 2014-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install socket.io-passport
pnpm add socket.io-passport
yarn add socket.io-passport
bun add socket.io-passport
```

## 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 | 2014-06-08 |
| First published | 2013-08-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Naoyuki Kanezawa |
| Maintainers | nkzawa |
| Keywords | auth, authentication, socket.io, passport, middleware |

## Links

- npm: https://www.npmjs.com/package/socket.io-passport
- Repository: https://github.com/nkzawa/socket.io-passport
- Issues: https://github.com/nkzawa/socket.io-passport/issues
- npm.io page: https://npm.io/package/socket.io-passport

## Alternatives

- [@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
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2014-06-08
- 0.1.0 — 2013-08-28
- 0.0.0 — 2013-08-27

## README

socket.io-passport
==================
[![Build Status](https://travis-ci.org/nkzawa/socket.io-passport.png?branch=master)](https://travis-ci.org/nkzawa/socket.io-passport)

[Passport](https://github.com/jaredhanson/passport) middleware for Socket.IO.

## Installation
    $ npm install socket.io-passport

## Usage
Use with [socket.io-bundle](https://github.com/nkzawa/socket.io-bundle).

```js
var passport = require('passport');
var bundle = require('socket.io-bundle');
var ioPassport = require('socket.io-passport');
var server = require('http').Server();
var io = require('socket.io')(server);

passport.deserializeUser(function(id, done) {
  done(null, {id: id, name: 'foo'});
});

io.use(bundle.cookieParser());
io.use(bundle.session({secret: 'my secret'}));
io.use(ioPassport.initialize());
io.use(ioPassport.session());

io.on('connection', function(socket) {
  console.log(socket.request.user);
});

server.listen(3000);
```

## License
MIT

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