Hello,
I have a problem, I don’t know if this is the right place or format to ask but it would be very greatfull if you could help me.
I need two different “instances” based on the a condition in the request.
Since oidc is stateless as far as I know I was hopful to get this working.
So I was trying to do something like this.
const app = express();
app.use((req, res, next)=>{
if(condition(req)){
return auth(config1)(req, res, next);
} else {
return auth(config2)(req, res, next);
}
});
but it doesn’t work
I narrowed down my problem and now have the info that
app.use(auth(config1));
works but
app.use((req, res, next)=>{return auth(config1)(req, res, next);});
doesn’t. I get error “
BadRequestError: checks.state argument is missing at responseContext.callback (context.js:366:15)
”
Does someone know the cause of this problem. I am kinda stuck.
Also could this work or is this doomed from the start because of some detail in the oidc protocol or the implementation that I am overlooking.