重定向localhost而不是myserver.org:3000/login/callback [英] redirect localhost instead of myserver.org:3000/login/callback
问题描述
一直一直重定向到我的本地主机服务器,而不是
being redirected all the time to my localhost-server, instead of
myserver.org:3000/login/callback
myserver.org:3000/login/callback
到
localhost:3000 / login / callback
localhost:3000/login/callback
不知道为什么以及从何而来
do not understand why and where from
这是我代码的一部分:
app.get('/', function(req, res){
res.render('index', { user: req.user });
});
app.get('/account', ensureAuthenticated, function(req, res){
res.render('account', { user: req.user });
});
app.get('/login',
passport.authenticate('saml', { failureRedirect: '/', failureFlash: true }),
function(req, res) {
console.log('so far worked out - =) 2');
res.redirect('/');
}
);
console.log('so far worked out - =) 1');
app.post('/login/callback',
passport.authenticate('saml', { failureRedirect: '/', failureFlash: true }),
function(req, res) {
console.log('so far worked out - =) 3');
// res.redirect('');
res.render('index', { user: req.user });
}
);
app.get('/Metadata', // <--- also doesn't work
function(req,res){
console.log(SAML.prototype.validatePostResponse);
console.log('so far worked out - =) 4');
req.type('application/xml');
res.send(200, samlStrategy.generateServiceProviderMetadata(cert));
}
);
不获取元数据...它不打印任何 console.log('so fa ...')
以及 console.log('so fa ... 1')
do not get the metadata... it doesn't print any of the console.log('so fa...')
besides with the console.log('so fa... 1')
希望有人看到此问题,谢谢...;)
hope somebody sees the problem thank you in advance ... ;)
(此处类似主题:重定向到localhost-stackoverflow )
推荐答案
另请参见 Node.js护照-saml一直一直重定向到localhost:3000 / login / callback ,我基本上在上面建议的内容相同,但请提供我使用的示例。
See also Node.js passport-saml redirects to localhost:3000/login/callback all the time where I basically do the same thing suggested above, but provide the example I used.
这篇关于重定向localhost而不是myserver.org:3000/login/callback的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!