Skip to content

Using Passport with SailsJS causing verify function to not fire #156

@AskYous

Description

@AskYous

Hello,

I'm building a web application from SailsJS. And on the readme page of this repository, it uses a middleware (here) that is not firing in my code. My code (using SailsJS) is:

routes.js:

// initial login page
'/login': passport.authenticate('saml', {
  'failureRedirect': '/fail',
  'failureFlash': true
}),

// login call pack
'/login/callback': function(req, res){
passport.authenticate('saml', {
          'failureRedirect': '/fail',
          'failureFlash': true
      });
      res.redirect('/success');
},

passport.js:

passport.use(new SamlStrategy(config, findByEmail(profile.email, function(err, user){
     // this function is not getting called at all
     if(err) return done(err);
     else return done(null, user);
})));

http.js (middleware):

'authenticationMiddleWare': function (req, res, next) {
  passport.authenticate('saml', {
    'failureRedirect': '/fail',
    'failureFlash': true
  });
  next();
},
passportInit    : passport.initialize(),
passportSession : passport.session(),

But when the call back occurs from the IDP, the verify function is never called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions