SAML响应中加密属性中的XML分析错误
我有一个基于springsecuritysaml的简单web应用程序(JSF)来测试BIG-ipf5作为IdP。在F5上登录后,当SAML响应中没有加密的属性时,一切正常,但只要一个属性被加密,就会出现XML解析错误。解密是可以的 在调试中,我可以看到所有未加密的属性都得到了处理,没有任何问题(类:SAML响应中加密属性中的XML分析错误,xml,spring-saml,f5,Xml,Spring Saml,F5,我有一个基于springsecuritysaml的简单web应用程序(JSF)来测试BIG-ipf5作为IdP。在F5上登录后,当SAML响应中没有加密的属性时,一切正常,但只要一个属性被加密,就会出现XML解析错误。解密是可以的 在调试中,我可以看到所有未加密的属性都得到了处理,没有任何问题(类:org.springframework.security.saml.webso.websoprofileConsumerImpl.processAuthenticationResponse(SAMLM
org.springframework.security.saml.webso.websoprofileConsumerImpl.processAuthenticationResponse(SAMLMessageContext)
),也是第一个加密的属性(密码)在类org.opensaml.xml.encryption.Decrypter.decryptDataToDOM(EncryptedData EncryptedData,Key dataEncKey)
中正确解密:解密后变量字节的值(作为字符串):
<saml2:Attribute Name="password" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"><saml2:AttributeValue>foo</saml2:AttributeValue></saml2:Attribute>
我想这个解密的XML片段中没有名称空间是导致错误的原因吧?有没有办法解决这个问题?这可能只是F5上的配置问题吗?提前谢谢
这是SAML断言,加密属性位于
<代码>
:
https://idp.foo.bar
…
555-123-456
foo@bar.com
555-345-678
MIIDUjCCA…
fdGfjQ2…
dEUUgk3A…
用户ID
[org.opensaml.xml.parse.StaticBasicParserPool]: XML Parsing Error org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 103; The prefix "saml2" for element "saml2:Attribute" is not bound.
<saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" ID="_b6cf253b4cb9338aca76d98c3a0bb12ba083c7" IssueInstant="2016-03-15T10:09:51Z" Version="2.0">
<saml2:Issuer>https://idp.foo.bar</saml2:Issuer>
…
<saml2:AttributeStatement>
<saml2:Attribute Name="mobile" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml2:AttributeValue>555-123-456</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="mail" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml2:AttributeValue>foo@bar.com</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="telephoneNumber" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml2:AttributeValue>555-345-678</saml2:AttributeValue>
</saml2:Attribute>
<saml2:EncryptedAttribute>
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="_76f515ac5b705170900e61bfc2e47c365496e1" Type="http://www.w3.org/2001/04/xmlenc#Element">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xenc:EncryptedKey Id="_e6bc635bd69d40954b107517e362560683e05d">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
</xenc:EncryptionMethod>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>MIIDUjCCA…</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>fdGfjQ2…</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedKey>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>dEUUgk3A…</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</saml2:EncryptedAttribute>
<saml2:Attribute Name="username" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml2:AttributeValue>userid</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
</saml2:Assertion>