passport-ifmosso

1.0.2 • Public • Published

passport-ifmosso

Passport strategy for authenticating via ITMO University Single Sign-On.

Install

$ npm install passport-ifmosso

Usage

Configure Strategy

The authentication strategy authenticates users using ITMO University account. The strategy requires a verify callback, which accepts these credentials and calls done providing a user.

passport.use(new IfmoSSOStrategy({
        secretKey: SECRET_KEY
    }, function(profile, done) {
        User.findOrCreate(..., function (err, user) {
            done(err, user);
        });
    }
));

Authenticate Requests

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

For example, as route middleware in an Express application:

app.post('/auth/callback',
    passport.authenticate('ifmosso', {
        successRedirect: '/',
        failureRedirect: '/login'
    })
);

Tests

$ npm install
$ npm test

Credits

License

The MIT License

Copyright (c) 2015 Anton Skshidlevsky

Package Sidebar

Install

npm i passport-ifmosso

Weekly Downloads

7

Version

1.0.2

License

none

Last publish

Collaborators

  • meefik