【问题标题】:Node JS and SAML example节点 JS 和 SAML 示例
【发布时间】:2017-08-18 14:11:03
【问题描述】:

我想构建将使用 SAML 保护的示例应用程序,我正在尝试使用 passport-saml

我在网上找到了很多示例程序。但无法帮助完成我的示例程序。

是否有提供分步说明的示例,我可以直接跟进。

我使用 SSOCircle 作为 IDP,它将我重定向到 SSOCircle 的 SSO 登录页面,但登录后它显示错误消息

发生错误原因:无法进行单点登录或联合。

以下是我在节点中的代码。

passport.use(new SamlStrategy(
{
  path: '/login/callback',
  entryPoint: 'https://idp.ssocircle.com:443/sso/SSORedirect/metaAlias/publicidp',
  issuer: 'comuteAWS',
  cert: ''
},
function (profile, done) {
  return done(null,
    {
      id: profile.uid,
      email: profile.email,
      displayName: profile.cn,
      firstName: profile.givenName,
      lastName: profile.sn
    });
})

);

我的 SP 元数据正在关注

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EntityDescriptor entityID="comuteAWS" xmlns="urn:oasis:names:tc:SAML:2.0:metadata"><SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"><NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</NameIDFormat><AssertionConsumerService index="0" isDefault="true" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://192.168.254.38:3000/vehicles"/></SPSSODescriptor></EntityDescriptor>

【问题讨论】:

    标签: node.js passport-saml


    【解决方案1】:

    我遇到了同样的问题,然后意识到 SSOCircle 的 entryPoint url 是错误的。

    对于 SSOCircle,您应该使用此网址,

    entryPoint: 'https://idp.ssocircle.com/sso/idpssoinit?metaAlias=%2Fpublicidp&spEntityID=Your-Entity-ID'
    

    Your-Entity-ID 替换为您的实体 ID。

    【讨论】:

      【解决方案2】:

      您需要将您的 SP 的 SAML 元数据导入信任的 SSOCircle。这是在“管理元数据”下的 SSOCircle 管理 UI 中完成的。

      【讨论】:

        【解决方案3】:

        我已经这样做了,但仍然无法正常工作。最后,我使用了 wso2 身份提供程序,并且使用了相同的代码。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2021-10-19
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-08-06
          • 1970-01-01
          • 2012-12-27
          相关资源
          最近更新 更多