Strategy naming for basic auth
korialis opened this issue · 1 comments
korialis commented
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 (jaredhanson/passport#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 });
korialis commented
My fault, had a misleading bug not relating passport, sorry for the useless issue...closing it!