0.1.1 • Published 9 years ago

passport-ssh v0.1.1

Weekly downloads
1
License
BSD-2-Clause
Repository
github
Last release
9 years ago

passport-ssh

Passport strategy for authenticating with ssh.

Installation

$ npm install passport-ssh

Usage

The ssh strategy authenticates users using ssh. You can specify server credentials to attempt to ssh into. For example:

Basic setup using ssh daemon running on localhost:22

passport.use(new SSHStrategy());

if i tried to login as user bob, the equivalent ssh command would be:

$ ssh bob@localhost

Example using custom hostname and port

passport.use(new SSHStrategy({
  host: "ec2-54-124-59-274.us-west-2.compute.amazonaws.com",
  port: 2200
}));

if i tried to login as user ubuntu, the equivalent ssh command would be:

$ ssh -p 2200 ubuntu@ec2-54-124-59-274.us-west-2.compute.amazonaws.com

You can optionally provide a verify callback to handle custom edge cases

passport.use(new SSHStrategy(
  function(user, done) {
    done(null, user);
  }
));

Authenticate Requests

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

app.get('/secret', passport.authenticate('ssh', { failureRedirect: '/login' }),
  function(req, res) {
    res.redriect("/");
  }
);

Tests

nah

0.1.1

9 years ago

0.1.0

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago