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

SEARCH FOR STRATEGIES

0STRATEGIES