passport-ifmosso
v1.0.2
Published
IfmoSSO authentication strategy for Passport.
Maintainers
Readme
passport-ifmosso
Passport strategy for authenticating via ITMO University Single Sign-On.
Install
$ npm install passport-ifmossoUsage
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 testCredits
License
Copyright (c) 2015 Anton Skshidlevsky
