Maybe I'm missing something: I'm trying to implement a service using different 'layers of authentication', to do so I'd like to specify 3 different BasicStrategy. As I understood from an old issue (https://github.com/jaredhanson/passport/issues/50) this is possible for LocalStrategy, but I've been unsuccessfull to do the same for BasicStrategy, since the constructor doesn't allow custom names.
Is there any reason for this asymmetric behaviour between the strategies?
I even tried to instantiate the strategy, then assign a custom name and use it like this:
var adminStrat = new BasicStrategy(.....);
passport.use('admin-strat', adminStrat);
exports.isAdmin = passport.authenticate('admin-strat', { session: false });
Maybe I'm missing something: I'm trying to implement a service using different 'layers of authentication', to do so I'd like to specify 3 different
BasicStrategy
. As I understood from an old issue (https://github.com/jaredhanson/passport/issues/50) this is possible forLocalStrategy
, but I've been unsuccessfull to do the same forBasicStrategy
, since the constructor doesn't allow custom names.Is there any reason for this asymmetric behaviour between the strategies?
I even tried to instantiate the strategy, then assign a custom name and use it like this: