为了从远程源获取元数据,我定义了一个ExtendedMetadataDelegate
bean,如下所示:
@Bean
@Qualifier("replyMeta")
public ExtendedMetadataDelegate replyMetadataProvider() throws MetadataProviderException {
String metadataURL = "https://ststest.mydomain.it/FederationMetadata/2007-06/FederationMetadata.xml";
final Timer backgroundTaskTimer = new Timer(true);
HTTPMetadataProvider provider = new HTTPMetadataProvider(
backgroundTaskTimer, httpClient(), metadataURL);
provider.setParserPool(parserPool());
ExtendedMetadataDelegate emd = new ExtendedMetadataDelegate(
provider, new ExtendedMetadata());
return emd;
}
为了确保签名信任的建立,我在JDK密钥库和应用程序密钥库中添加了相关的密钥(第二步可能还不够);尽管如此,运行webapp时还是会出错。
[2014-08-18 14:36:47.200] boot - 6000 DEBUG [localhost-startStop-1] --- SignatureValidator: Attempting to validate signature using key from supplied credential
[2014-08-18 14:36:47.200] boot - 6000 DEBUG [localhost-startStop-1] --- SignatureValidator: Creating XMLSignature object
[2014-08-18 14:36:47.206] boot - 6000 DEBUG [localhost-startStop-1] --- SignatureValidator: Validating signature with signature algorithm URI: http://www.w3.org/2001/04/xmldsig-more#rsa-sha256
[2014-08-18 14:36:47.207] boot - 6000 DEBUG [localhost-startStop-1] --- SignatureValidator: Validation credential key algorithm 'RSA', key instance class 'sun.security.rsa.RSAPublicKeyImpl'
[2014-08-18 14:36:47.329] boot - 6000 DEBUG [localhost-startStop-1] --- SignatureValidator: Signature validated with key from supplied credential
[2014-08-18 14:36:47.329] boot - 6000 DEBUG [localhost-startStop-1] --- BaseSignatureTrustEngine: Signature validation using candidate credential was successful
[2014-08-18 14:36:47.330] boot - 6000 DEBUG [localhost-startStop-1] --- BaseSignatureTrustEngine: Successfully verified signature using KeyInfo-derived credential
[2014-08-18 14:36:47.330] boot - 6000 DEBUG [localhost-startStop-1] --- BaseSignatureTrustEngine: Attempting to establish trust of KeyInfo-derived credential
[2014-08-18 14:36:47.330] boot - 6000 DEBUG [localhost-startStop-1] --- BasicX509CredentialNameEvaluator: Supplied trusted names are null or empty, skipping name evaluation
[2014-08-18 14:36:47.331] boot - 6000 DEBUG [localhost-startStop-1] --- MetadataCredentialResolver: Attempting PKIX path validation on untrusted credential: [subjectName='CN=ADFS Signing - ststest-replynet.reply.it']
[2014-08-18 14:36:47.346] boot - 6000 ERROR [localhost-startStop-1] --- MetadataCredentialResolver: PKIX path construction failed for untrusted credential: [subjectName='CN=ADFS Signing - ststest-replynet.reply.it']: unable to find valid certification path to requested target
[2014-08-18 14:36:47.347] boot - 6000 DEBUG [localhost-startStop-1] --- PKIXSignatureTrustEngine: Signature trust could not be established via PKIX validation of signing credential
[2014-08-18 14:36:47.347] boot - 6000 DEBUG [localhost-startStop-1] --- BaseSignatureTrustEngine: Failed to establish trust of KeyInfo-derived credential
[2014-08-18 14:36:47.347] boot - 6000 DEBUG [localhost-startStop-1] --- BaseSignatureTrustEngine: Failed to verify signature and/or establish trust using any KeyInfo-derived credentials
[2014-08-18 14:36:47.347] boot - 6000 DEBUG [localhost-startStop-1] --- PKIXSignatureTrustEngine: PKIX validation of signature failed, unable to resolve valid and trusted signing key
[2014-08-18 14:36:47.347] boot - 6000 ERROR [localhost-startStop-1] --- SignatureValidationFilter: Signature trust establishment failed for metadata entry http://ststest-replynet.reply.it/adfs/services/trust
[2014-08-18 14:36:47.349] boot - 6000 ERROR [localhost-startStop-1] --- AbstractReloadingMetadataProvider: Error filtering metadata from https://ststest-replynet.reply.it/FederationMetadata/2007-06/FederationMetadata.xml
org.opensaml.saml2.metadata.provider.FilterException: Signature trust establishment failed for metadata entry
错误通过设置消失:
emd.setMetadataTrustCheck(false);
...但是我想检查用过的元数据。
有没有办法解决这个错误?
我尝试按如下方式设置ExtendedMetadata
,但错误仍然存在。
em.setAlias("defaultAlias");
em.setSigningKey("*.mydomain.it (Go Daddy Secure Certification Authority)");
我面临着同样的issue.Steps,我一直在努力解决同样的问题
我发布这个以防万一,即使它可能有帮助,即使你做了所有喜欢接受这个问题的答案,仍然得到同样的错误。
我也有这个问题,我添加了IDP的元数据文件并将他们的证书导入我的应用密钥库。但仍然有签名信任验证问题。我确实在Intellij中格式化了IDP的metadata.xml,这确实搞砸了。一旦我导入了他们的元数据文件,而没有格式化,一切都很好。
您很可能导入了HTTPS证书,但没有导入用于创建签名的证书-它们是不同的。您应该:
>
创建文件签名。从元数据中提取以下内容的cer:
-----BEGIN CERTIFICATE-----
MIIC7jCCAdagAwIBAgIQa+pSaOoDP6ZL3qAi564CxzANBgkqhkiG9w0BAQs
FADAzMTEwLwYDVQQDEyhBREZTIFNpZ25pbmcgLSBzdHN0ZXN0LXJlcGx5bm
V0LnJlcGx5Lml0MB4XDTE0MDQyMTAwMzUyNVoXDTE1MDQyMTAwMzUyNVowM
zExMC8GA1UEAxMoQURGUyBTaWduaW5nIC0gc3RzdGVzdC1yZXBseW5ldC5y
ZXBseS5pdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJyI7Se
+UGGHOGRcwHF8LrmivtcPJyNKyicPJ8UJ8pIsEmgYBnJIrpS05RkYtdUdk+
aumDlc3ACt23FxGDLy9hkJJlRbZwklzh4W3RqGC3W5Y+t7KeIuB8d7ZrrLb
2AoJpVHICRagsLjjHMwz9sJUt+PZdUFFc0pZckHba3TY2Y+MgPYVsyjlEkf
QrwL0ggh23g9Pe1VQ9HaInXZvwVMGWZ1oL4Uk0cW11URa8x53ZOWMQSsksi
MUlquItssiuJjRnI9Df+GaDxbQJi51esY2EF1o2JxqGJSA71Apy9EahDho8
eFkfOS0fYbVNBU5X/Wn7BKsf2Rmg3r6mQM94+gAA8CAwEAATANBgkqhkiG9
w0BAQsFAAOCAQEAIX5FEt5JWtINzy4C0LtTtta3DMOsLIBH3raRr53+6MKG
sPP75VAt7fYUutopuk5Y2o++sVPuEuTzcogz5Dj8eglDESkPwR0PrlClVcG
FLFEx9qOOidYIEa90g462niIOgkNkIpb1JRrmZEFo+yrYYdFSR2iXzC3O1f
7JAhNwi+d4a8cOTrqynqL6p1z+hiWEub39FlWDPacELw9HSDIYY151hiiPz
vIRQDBOjDg3Ws8fRwYNjJH4ElwjP2z+1r+sktD/kkh8jj3iWhT37JnQG72D
7c63ovYICwEZUqS4L3vepO0pv6xewkUbfX4KBQbUPaVVgmVUcSecj85mvMx
42g==
-----END CERTIFICATE-----
使用以下命令将证书导入samlKeystore.jks:
keytool -importcert -alias adfssigning -keystore samlKeystore.jks -file signature.cer
这应该是您所需要的全部,只需重新启动Tomcat,您的元数据加载现在就可以通过了。
您不需要在 JDK 的 cacerts 中包含 HTTPS 证书,以防包含以下配置 HTTP 客户端的 Bean(在 Spring SAML 1.0.0.RELEASE 中可用):
<bean class="org.springframework.security.saml.trust.httpclient.TLSProtocolConfigurer"/>
在安全上下文中配置 IDP 后,当我尝试运行我的服务器时,我收到以下异常.xml。 原因:org.opensaml.saml2.metadata.provider。筛选器异常:元数据条目的签名信任建立失败 我看到 http://forum.spring.io/forum/spring-projects/security/saml/108450-getting-error-signature-tru
我看过很多问题,包括 https://stackoverflow.com/a/25384924/1317559。我有IdP元数据和证书,但似乎无法获得Spring,所以看到它。 将证书添加到密钥库:keytool-importcert-alias-adfssigning-keystore-samlKeystore。jks-文件证书。crt 元数据中有多个证书(2个不同的证书)和一个Signatur
2016年8月1日11:34:39 AM org.apache.catalina.core.standardWrapperValve在路径为[/travelocity.com]的上下文中为servlet[jsp]调用严重:servlet.service()引发了异常[SAML响应的签名验证失败],根本原因为org.wso2.carbon.identity.sso.agent.exception.s
我在Tomcat 7上使用Spring Security SAML 2.0示例webapp,并对其进行了修改,以尝试让其通过Ping身份验证服务。webapp正在与服务对话,并返回一个断言,但在尝试验证签名时失败,如下调试输出所示: 我知道它无法验证签名,并且我已经获得了ping身份管理员要使用的证书,但我不确定如何将其包含在应用程序中。我尝试过使用JDK的keytools程序将其添加到示例应用程
问题内容: 我试图使用(java)密钥工具创建一个自签名证书,但是当我尝试使用它时,出现以下异常(有关完整异常,请参见底部)。 我知道我可以使用以下代码绕过此代码: (资源) 但是我对此解决方案不感兴趣,因为我认为这会造成安全漏洞。(如果我错了,请纠正我)。 谁能指出我正确的方向?我目前正在本地进行测试,因此很容易进行更改。我可以访问服务器代码,客户端代码和.keystore文件。 更新资料 我试
我已经通过复制我计划连接的Idp的509条目生成了testIdp.cer文件。然后,我通过执行以下命令创建了JKS文件 执行时,它要求输入我已提供密码的密码。对于问题“信任此证书?[no]:“,我给出了”y“作为输入。消息显示为“证书已添加到密钥库”。 然后,我在securityContext.xml中配置了以下详细信息: 但是当我运行应用程序时,在服务器启动和加载应用程序的主页时,我得到了以下两