【问题标题】:SAML 2.0 Unable to see X509Certificate value in SAML assertionSAML 2.0 无法在 SAML 断言中看到 X509Certificate 值
【发布时间】:2015-06-16 14:42:20
【问题描述】:

我在 saml 配置中正确加载了 Jks 和 *.cer 文件,但生成的 saml 断言无法在签名中找到像 , , 等证书标签...这可能是我正确配置 Keyinfo 对象的原因

KeyInfo keyInfo = (KeyInfo)create(KeyInfo.class, KeyInfo.DEFAULT_ELEMENT_NAME);

<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#_27ffd2e4ee3090abd76890d5436b2f62"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="xs" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>iCKAJTHHj1GGfZi6oIIBabGSl2c=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>09n/W4DWmgdvaRF6X88A7Mn7SiYPLB/pWL8rC6GuwqTGhGtHLkljahzVTYATdY84zglyrIoX+ANrIgdz9ITkdZIanm1bI5VgploBcEzjDufEJDQm7DbEPZtBp/PkTLalV+h17D2c3TBGxht1fsJ9IrHFZyNOoukBareyAZwjPLE=</ds:SignatureValue></ds:Signature>

【问题讨论】:

    标签: single-sign-on saml-2.0 opensaml


    【解决方案1】:

    尝试使用BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator的生成功能

    如果你发送你的凭证,你会得到一个 keyinfo 对象。

    然后在你的签名上使用 setKeyInfo 来添加信息

    【讨论】:

      【解决方案2】:

      嘿,谢谢 Stefan 跟随我丢失并添加相同的 发现工作错过添加 publicKey...

      KeyInfoHelper.addPublicKey(keyInfo, signingCredential.getPublicKey());
            signature.setKeyInfo(keyInfo);
      

      【讨论】:

        【解决方案3】:

        请在您的web.config 中启用详细日志记录。当然,您将能够捕捉到异常的确切原因。

        通常是由于“Microsoft Enhanced RSA and AES Cryptographic”问题。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-06-29
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多