Hello .
I am currently working on Okta login/logout integration in my application.
On front end we have Angular and Backend is Node with express middleware
I have login Page, which uses Okta Sign in Widget . Once user is logged in oidc.ensureAuthentication () function is called on every protect route to make sure its a valid session.
I have expressOIDC middleware set up in my server .js file
var oidc = new ExpressOIDC({
issuer: `${configSettings.orgUrl}/oauth2/default`,
client_id: configSettings.keys.id,
client_secret: configSettings.keys.clientSecret,
redirect_uri: configSettings.keys.redirectUri,
routes: {
login:{
path:'/user/sign-in-beta'
},
callback: {
handler:function(req,res,next){
console.log('Callback........',req.user);
next();
},
defaultRedirect: "/"
}
},
scope: 'openid profile email'
});
As soon as user sign is , callback will print user information.
Issue is : When i logout , in oidc i am just calling
logOff : function logOff(req, res){
req.logout();
res.redirect(’/’);
},
This logout does not clear my session and it will redirect me to sign in page, because on UI i am redirecting to sing . html, but i guess there is some setting i missed or logout url redirect is not correct. I am not sure what should be the flow on logout and what setting should i add. Can somebod provide an example, or may be i missed a callback handler but by default its ‘authorization-code/callback’ which should enter into
callback: {
handler:function(req,res,next){
console.log('Callback........',req.user);
next();
},
defaultRedirect: "/"
}
i am not sure
Below is my Okta App url redirects