Saml 策略验证回调未被调用
Saml Strategy Verify callback not getting called
根据 passportjs 文档,验证程序函数应该被调用。
但是我没有看到这个回调。
我正在用 okta 测试这个。在 okta 中,应用程序配置为将 saml 响应发送到 /fromokta
okta 正在重定向到 /fromokta
我错过了什么?
const saml = require('passport-saml').Strategy;
var strategy = new saml({
entryPoint: "<some oktka entiry point>",
issuer: "http://www.okta.com/foobar",
protocol: "http://"
},(profile, done) => {
console.log(">>>> callback from okta");
console.log(profile);
done(profile)
})
app.post('/login', function(req, res) {
passport.authenticate(
'saml',
{
//successRedirect: '/success',
failureRedirect: '/'
}
)}
)
app.post('/fromokta', function(req, resp){
// this gets called
})
这很可能意味着您的 POST /login 路由永远不会收到请求。查看网络请求,看看是否确实有 POST /login 到 URL,确保协议也相同(http 和 https)
根据 passportjs 文档,验证程序函数应该被调用。 但是我没有看到这个回调。
我正在用 okta 测试这个。在 okta 中,应用程序配置为将 saml 响应发送到 /fromokta okta 正在重定向到 /fromokta 我错过了什么?
const saml = require('passport-saml').Strategy;
var strategy = new saml({
entryPoint: "<some oktka entiry point>",
issuer: "http://www.okta.com/foobar",
protocol: "http://"
},(profile, done) => {
console.log(">>>> callback from okta");
console.log(profile);
done(profile)
})
app.post('/login', function(req, res) {
passport.authenticate(
'saml',
{
//successRedirect: '/success',
failureRedirect: '/'
}
)}
)
app.post('/fromokta', function(req, resp){
// this gets called
})
这很可能意味着您的 POST /login 路由永远不会收到请求。查看网络请求,看看是否确实有 POST /login 到 URL,确保协议也相同(http 和 https)