【问题标题】:SAML Logout fails: Issuer does not match (NodeJS + Okta)SAML 注销失败:颁发者不匹配(NodeJS + Okta)
【发布时间】:2019-09-20 18:00:21
【问题描述】:

我正在尝试以 Okta 作为我的 IdP 使用 SAML 进行注销。我在 Okta 日志中收到“发行者不匹配”:

我已经设置了单点注销:

上传的证书是我的 SP 公钥。


代码方面:

const config = require('../../app/config')
const saml = require('saml2-js')

module.exports = {
  sp: new saml.ServiceProvider({
    entity_id: `${config.HOSTNAME}/saml/assert`,
    private_key: config.SAML_SP_PRIVATE_KEY,
    certificate: config.SAML_SP_PUBLIC_KEY,
    assert_endpoint: `${config.HOSTNAME}/saml/assert`,
    allow_unencrypted_assertion: true,
    sign_get_request: true
  }),

  idp: new saml.IdentityProvider({
    sso_login_url: config.SAML_SSO_LOGIN_URL,
    sso_logout_url: config.SAML_SSO_LOGOUT_URL,
    certificates: config.SAML_SSO_IDP_CERT,
    sign_get_request: true
  })
}

以及注销功能:

if (!req.signedCookies.token) {
  res.status(400).send('Missing token')
  return
}
const tokenData = await jwtVerify(req.signedCookies.token, config.AUTH_SECRET)
const options = {
  name_id: tokenData.name_id,
  session_id: tokenData.session_id,
  sign_get_request: true
}

const createLogoutRequestUrl = util.promisify(sp.create_logout_request_url).bind(sp)
const logoutUrl = await createLogoutRequestUrl(idp, options)
res.redirect(logoutUrl)

【问题讨论】:

    标签: node.js saml saml-2.0 okta


    【解决方案1】:

    OK 发现了我的错误:

    我的 SP entity_id 应该是元数据 URL

    entity_id: `${config.HOSTNAME}/saml/metadata`,
    

    配置也应该反映在 okta 中:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-24
      • 2017-02-23
      • 1970-01-01
      • 1970-01-01
      • 2019-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多