简体   繁体   English

OneLogin Java-SAML SP无法向Shibboleth IdP提供签名的元数据

[英]OneLogin Java-SAML SP fails to provide signed metadata to Shibboleth IdP

When the sample application of OneLogin Java-SAML toolkit is configured to provide signed SP metadata to Shibboleth IdP, the IdP rejects the metadata signature complaining about invalid transform used in the signing process. 当OneLogin Java-SAML工具箱的示例应用程序配置为向Shibboleth IdP提供签名的SP元数据时,IdP拒绝抱怨在签名过程中使用无效转换的元数据签名。 However, the validation of the signature by standard XML tools like oXygen editor and the like succeeds. 但是,通过标准XML工具(如oXygen编辑器等)进行的签名验证成功。

The java-saml-tookit-jspsample-2.2.0 application has been configured to provide signed metadata to IdP ( onelogin.saml2.security.sign_metadata = true ) and the IdP's metadata-providers.xml contains configuration block using file-backed HTTP requiring signature validation. 已将java-saml-tookit-jspsample-2.2.0应用程序配置为向IdP提供签名的元数据( onelogin.saml2.security.sign_metadata = true ),并且IdP的onelogin.saml2.security.sign_metadata = true -providers.xml包含使用文件支持的HTTP要求的配置块签名验证。

What is wrong on this configuration? 此配置有什么问题?

After some hours of googling I found a similar issue in other software. 经过数小时的谷歌搜索,我在其他软件中发现了类似的问题。 The Java-SAML toolkit by OneLogin uses a cannonicalization method to sign the metadata that is legal, but it is NOT explicitly allowed by the SAML standard. OneLogin的Java-SAML工具箱使用规范化方法对合法的元数据进行签名,但SAML标准未明确允许该元数据。 If you check the section 5.5.4 of SAML2 specification, it states explicitly: 如果检查SAML2规范的5.5.4节,则明确指出:

Signatures in SAML messages SHOULD NOT contain transforms other than the enveloped signature transform (with the identifier http://www.w3.org/2000/09/xmldsig#enveloped-signature ) or the exclusive canonicalization transforms (with the identifier http://www.w3.org/2001/10/xml-exc-c14n# or http://www.w3.org/2001/10/xml-exc-c14n#WithComments ). SAML消息中的签名不应包含封装签名转换(标识为http://www.w3.org/2000/09/xmldsig#enveloped-signature )或专有规范化转换(标识为http:/ )以外的其他转换。 /www.w3.org/2001/10/xml-exc-c14n#http://www.w3.org/2001/10/xml-exc-c14n#WithComments )。 Verifiers of signatures MAY reject signatures that contain other transform algorithms as invalid. 签名验证者可以拒绝包含其他变换算法的签名无效。

The Java-SAML toolkit has a hard-wired setting for this using http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments instead that gets rejected by Shibboleth IdP. Java-SAML工具箱为此使用http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments进行了硬连接设置,但Shibboleth IdP拒绝了它。 If you want to get things going, download the source of the Java-SAML toolkit from OneLogin, unpack it, and then change line 1056 of java-saml-2.2.0/core/src/main/java/com/onelogin/saml2/util/Util.java from 如果您想让一切顺利,请从OneLogin下载Java-SAML工具包的源代码,解压缩,然后更改java-saml-2.2.0 / core / src / main / java / com / onelogin / saml2的第1056行来自的/util/Util.java

String c14nMethod = Constants.C14N_WC;

to

String c14nMethod = Constants.C14NEXC_WC;

Recompile using maven (mvn package) and re-deploy the application. 使用maven(mvn软件包)重新编译并重新部署应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM