【问题标题】:Saml Strategy Verify callback not getting calledSaml 策略验证回调没有被调用
【发布时间】:2021-01-31 16:52:58
【问题描述】:

根据 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
})

【问题讨论】:

    标签: passport-saml


    【解决方案1】:

    这很可能意味着您的 POST /login 路由永远不会收到请求。查看网络请求,看看是否确实有 POST /login 到 URL,确保协议也相同(http 和 https)

    【讨论】:

      猜你喜欢
      • 2018-09-14
      • 2017-10-12
      • 1970-01-01
      • 2013-09-12
      • 2019-03-19
      • 2013-12-21
      • 1970-01-01
      • 2021-09-11
      相关资源
      最近更新 更多