Node JS read SSO headers before ensureAuthenticated


#1

I built an application using Okta oidc sdk on Node JS express. I don’t see any issue with basic authentication. But, I have a question on integrating SSO. If another application passed SSO cookie-header to my application, how do i read it? Even before it comes to the request, Okta redirects to the sign in page so I am unable to read the header. Can anyone help?

app.get(’/’, oidc.ensureAuthenticated(), function(req, res){
console.log(req.headers[‘AccessToken’]); /* Unable to read this, as it automatically redirects to login page */
});