Express 如何使用passport saml修复SLO,该saml在第一次注销时有效,但在后续注销时无效
我必须将应用程序连接到公司的ADFS服务器。我正在为SSO和SLO使用passport saml。SSO工作,SLO仅在第一次注销时工作。我试图让SLO在用户每次注销时都能正常工作 我一直在到处寻找这个问题的解决办法,但它回避了我。详情如下:Express 如何使用passport saml修复SLO,该saml在第一次注销时有效,但在后续注销时无效,express,adfs,passport-saml,Express,Adfs,Passport Saml,我必须将应用程序连接到公司的ADFS服务器。我正在为SSO和SLO使用passport saml。SSO工作,SLO仅在第一次注销时工作。我试图让SLO在用户每次注销时都能正常工作 我一直在到处寻找这个问题的解决办法,但它回避了我。详情如下: 我清除浏览器中的Cookie,从头开始 我登录到我的应用程序,该应用程序重定向到ADFS的登录页面 输入用户凭据,然后ADFS重定向回我的应用程序主页 我注销了我的应用程序,一个请求被发送到ADFS服务器,在本地和ADFS上终止我的会话,然后我被重定向回我
http://myadfs.org/adfs/services/trust 用户名_1df683da-3859-45c5-883d-076dba7b297b
在随后未成功注销时:
HTTP:
获取HTTP/1.1
主持人:myadfs.org
用户代理:Mozilla/5.0(Macintosh;英特尔Mac OS X 10.14;rv:66.0)Gecko/20100101 Firefox/66.0
接受:text/html、application/xhtml+xml、application/xml;q=0.9,/;q=0.8
接受语言:en-US,en;q=0.5
接受编码:gzip,deflate,br
推荐人:
连接:保持活力
Cookie:msisLopDetectionCookie=mjaxOS0WNC0xNjoxMTOYODYNOYNLPCMQ==;这是一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的概念,一个新的一个新的概念,新的概念,新的概念,新的概念,新的概念,新的概念,新的概念,新的概念,新的概念,新的概念,新的知识,新的知识,新的知识,新的知识,新的知识,新的中国中国中国中国中国中国中国中国的中国的中国的中国的一一一个新的知识,新的知识,新的知识,新的知识,新的知识,新的知识,新的新西兰;返回URL=AHR0CHM6LY9YCHBZC29KZXYUBW9MZML0DC5VCMC6NDQZL2FKZNMVB3DHPXDZAWDUB3V0MS4W;MSISSignoutProtocol=U2FtbA==;MSISAuth=AAEAAFOnxdlEvO8Le/Gti39Bx6BFj1cEJ39/A6ogocbLbXlBnq07uT1v+muazzs0nqyb1wmqx3o8otwpancfpcefqbngzsvswi/oAXmuDih8uBG9MVPfstAu/cfpxl95v2iujx6r3tv08fqipxw/1cha7qm8qm8vxu5a516zfsztaxke+ITD3B
const fs = require('fs');
const passport = require('passport');
const SamlStrategy = require('passport-saml').Strategy;
require('dotenv').config();
passport.serializeUser((user, done) => {
done(null, user);
});
passport.deserializeUser((user, done) => {
done(null, user);
});
passport.use(new SamlStrategy({
entryPoint: 'https://myadfs.org/adfs/ls',
issuer: 'https://example.com',
callbackUrl: process.env.NODESERVERURL + ':' + process.env.PORT + '/authenticate/adfs/postResponse',
privateCert: fs.readFileSync(__dirname + '/private/keys/fpcdr.key', 'utf-8'),
logoutUrl: 'https://myadfs.org/adfs/ls/?wa=wsignout1.0',
signatureAlgorithm: 'sha256'
},
function(profile, done) {
const username = profile.nameID.toLowerCase();
const email = profile['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'].toLowerCase();
const sessionIndex = profile.sessionIndex;
return done(null, {
username,
email,
sessionIndex
});
})
);
module.exports = passport;
module.exports.adfsAuthenticate = function(req, res) {
const email = req.user.email;
const username = req.user.username;
if (process.env.UAT === 'true') {
res.status(302).redirect(LANDING_PAGE_REDIRECT_DEV);
} else {
res.status(302).redirect(LANDING_PAGE_REDIRECT_PROD);
}
};
module.exports.logout = function(req, res) {
req.logout();
req.session.destroy(function (err) {
if (!err) {
res.status(200).clearCookie('connect.sid', {path: '/'}).json({status: "Success"});
} else { alert(err); }
});
};