You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "Dan Taylor (JIRA)" <ji...@apache.org> on 2012/06/13 21:44:42 UTC
[jira] [Created] (WSS-394) WSS4J is not handling X509Data inside
SecurityTokenReference inside a KeyInfo
Dan Taylor created WSS-394:
------------------------------
Summary: WSS4J is not handling X509Data inside SecurityTokenReference inside a KeyInfo
Key: WSS-394
URL: https://issues.apache.org/jira/browse/WSS-394
Project: WSS4J
Issue Type: Bug
Components: WSS4J Core
Affects Versions: 1.6.6
Environment: .NET client, .NET STS, Java service, Windows 7.0
Reporter: Dan Taylor
Assignee: Colm O hEigeartaigh
Fix For: 1.6.7
We have a .NET client using a .NET STS for authentication and authorization to our java service. The .NET STS puts a SecurityTokenReference inside a KeyInfo element, with an X509Data inside the STR. This causes an exception to be thrown: General security error (SAML token security failure).
>From debugging into the WSS4J source in the SAMLUtil.getCredentialFromKeyInfo method, keyInfoElement.getFirstChild() returns the SecurityTokenReference element. Inside this element is the X509Data element, which should be handled correctly..
>From the WS-Security 1.1 (Web Services Security: SOAP Message Security 1.1) standard:
Section 7.1: “All compliant implementations MUST be able to process a <wsse:SecurityTokenReference> element. This element can also be used as a direct child element of <ds:KeyInfo> to indicate a hint to retrieve the key information from a security token placed somewhere else. In particular, it is RECOMMENDED, when using XML Signature and XML Encryption, that a <wsse:SecurityTokenReference> element be placed inside a <ds:KeyInfo> to reference the security token used for the signature or encryption.”
>From the Web Services Security X.509 Certificate Token Profile 1.1) standard:
Section 3.2: “In order to ensure a consistent processing model across all the token types supported by WSS: SOAP Message Security, the <wsse:SecurityTokenReference> element SHALL be used to specify all references to X.509 token types in signature or encryption elements that comply with this profile.”
Sample SAMLToken:
<saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981" Issuer="sts" IssueInstant="2012-06-12T15:25:49.393Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
<saml:Conditions NotBefore="2012-06-12T15:25:49.393Z" NotOnOrAfter="2012-06-13T01:25:49.393Z"></saml:Conditions>
<saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2012-06-12T15:25:49.397Z">
<saml:Subject>
<saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
<saml:SubjectConfirmation>
<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
</e:EncryptionMethod>
<KeyInfo>
<o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
</o:SecurityTokenReference>
</KeyInfo>
<e:CipherData>
<e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
</e:CipherData>
</e:EncryptedKey>
</KeyInfo>
</saml:SubjectConfirmation>
</saml:Subject>
</saml:AuthenticationStatement>
<saml:AttributeStatement>
<saml:Subject>
<saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
<saml:SubjectConfirmation>
<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
</e:EncryptionMethod>
<KeyInfo>
<o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
</o:SecurityTokenReference>
</KeyInfo>
<e:CipherData>
<e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
</e:CipherData>
</e:EncryptedKey>
</KeyInfo>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Attribute AttributeName="roles" AttributeNamespace="http://schemas.merge.com/icc/claims">
<saml:AttributeValue>User</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
<saml:AttributeStatement>
<saml:Subject>
<saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
<saml:SubjectConfirmation>
<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
</e:EncryptionMethod>
<KeyInfo>
<o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
</o:SecurityTokenReference>
</KeyInfo>
<e:CipherData>
<e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
</e:CipherData>
</e:EncryptedKey>
</KeyInfo>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
<saml:AttributeValue>test@merge.com</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
<saml:AttributeStatement>
<saml:Subject>
<saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
<saml:SubjectConfirmation>
<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
</e:EncryptionMethod>
<KeyInfo>
<o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
</o:SecurityTokenReference>
</KeyInfo>
<e:CipherData>
<e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
</e:CipherData>
</e:EncryptedKey>
</KeyInfo>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Attribute AttributeName="privatepersonalidentitfier" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
<saml:AttributeValue>55</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
<Reference URI="#SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
<DigestValue>P0aIAqKPikgPXLn4TfcF1z5ZmZo=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>fGTlN2CXzqSsdLS8pH4r3gqmwGTo40uqSvnioMd6bl/PdgAgLw0OtirVZFofVEQWQXY1yuGjzOX0w7CeyfjprOHf/bLphoem1oyjJe+QDCtKA41faXhXbJOEtbksdxqui+qU+YwqStbJJmi/F9yijjuwnuwbDhI48SqcdmZcsY8=</SignatureValue>
<KeyInfo>
<o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<X509Data>
<X509IssuerSerial>
<X509IssuerName>CN=SUNCA, OU=JWS, O=SUN, S=Some-State, C=AU</X509IssuerName>
<X509SerialNumber>2</X509SerialNumber>
</X509IssuerSerial>
</X509Data>
</o:SecurityTokenReference>
</KeyInfo>
</Signature>
</saml:Assertion>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
[jira] [Commented] (WSS-394) WSS4J is not handling X509Data inside
SecurityTokenReference inside a KeyInfo
Posted by "Dan Taylor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WSS-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13396977#comment-13396977 ]
Dan Taylor commented on WSS-394:
--------------------------------
Hi Colm,
Failure trace using the latest snapshot code:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Jun 19, 2012 2:39:07 PM org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor handleMessage
WARNING:
org.apache.ws.security.WSSecurityException: General security error (SAML token security failure)
at org.apache.ws.security.saml.ext.AssertionWrapper.verifySignature(AssertionWrapper.java:546)
at org.apache.ws.security.processor.SAMLTokenProcessor.handleSAMLToken(SAMLTokenProcessor.java:109)
at org.apache.ws.security.processor.SAMLTokenProcessor.handleToken(SAMLTokenProcessor.java:53)
at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:396)
at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:249)
at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:85)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:193)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:126)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Jun 19, 2012 2:39:07 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://merge.com/icc/services/mergedemo/}MergeDemoService has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: General security error (SAML token security failure)
at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:643)
at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:308)
at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:85)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:193)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:126)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.ws.security.WSSecurityException: General security error (SAML token security failure)
at org.apache.ws.security.saml.ext.AssertionWrapper.verifySignature(AssertionWrapper.java:546)
at org.apache.ws.security.processor.SAMLTokenProcessor.handleSAMLToken(SAMLTokenProcessor.java:109)
at org.apache.ws.security.processor.SAMLTokenProcessor.handleToken(SAMLTokenProcessor.java:53)
at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:396)
at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:249)
... 27 more
Jun 19, 2012 2:39:08 PM org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor$Soap12FaultOutInterceptorInter
nal handleMessage
INFO: class org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor$Soap12FaultOutInterceptorInternalapplicati
on/soap+xml
Thanks,
Dan
> WSS4J is not handling X509Data inside SecurityTokenReference inside a KeyInfo
> -----------------------------------------------------------------------------
>
> Key: WSS-394
> URL: https://issues.apache.org/jira/browse/WSS-394
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 1.6.6
> Environment: .NET client, .NET STS, Java service, Windows 7.0
> Reporter: Dan Taylor
> Assignee: Colm O hEigeartaigh
> Labels: KeyInfo, SecurityTokenReference, X509Data
> Fix For: 1.6.7
>
>
> We have a .NET client using a .NET STS for authentication and authorization to our java service. The .NET STS puts a SecurityTokenReference inside a KeyInfo element, with an X509Data inside the STR. This causes an exception to be thrown: General security error (SAML token security failure).
> From debugging into the WSS4J source in the SAMLUtil.getCredentialFromKeyInfo method, keyInfoElement.getFirstChild() returns the SecurityTokenReference element. Inside this element is the X509Data element, which should be handled correctly..
> From the WS-Security 1.1 (Web Services Security: SOAP Message Security 1.1) standard:
> Section 7.1: “All compliant implementations MUST be able to process a <wsse:SecurityTokenReference> element. This element can also be used as a direct child element of <ds:KeyInfo> to indicate a hint to retrieve the key information from a security token placed somewhere else. In particular, it is RECOMMENDED, when using XML Signature and XML Encryption, that a <wsse:SecurityTokenReference> element be placed inside a <ds:KeyInfo> to reference the security token used for the signature or encryption.”
> From the Web Services Security X.509 Certificate Token Profile 1.1) standard:
> Section 3.2: “In order to ensure a consistent processing model across all the token types supported by WSS: SOAP Message Security, the <wsse:SecurityTokenReference> element SHALL be used to specify all references to X.509 token types in signature or encryption elements that comply with this profile.”
> Sample SAMLToken:
> <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981" Issuer="sts" IssueInstant="2012-06-12T15:25:49.393Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
> <saml:Conditions NotBefore="2012-06-12T15:25:49.393Z" NotOnOrAfter="2012-06-13T01:25:49.393Z"></saml:Conditions>
> <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2012-06-12T15:25:49.397Z">
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> </saml:AuthenticationStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="roles" AttributeNamespace="http://schemas.merge.com/icc/claims">
> <saml:AttributeValue>User</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>test@merge.com</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="privatepersonalidentitfier" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>55</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
> <Reference URI="#SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981">
> <Transforms>
> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValue>P0aIAqKPikgPXLn4TfcF1z5ZmZo=</DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValue>fGTlN2CXzqSsdLS8pH4r3gqmwGTo40uqSvnioMd6bl/PdgAgLw0OtirVZFofVEQWQXY1yuGjzOX0w7CeyfjprOHf/bLphoem1oyjJe+QDCtKA41faXhXbJOEtbksdxqui+qU+YwqStbJJmi/F9yijjuwnuwbDhI48SqcdmZcsY8=</SignatureValue>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <X509Data>
> <X509IssuerSerial>
> <X509IssuerName>CN=SUNCA, OU=JWS, O=SUN, S=Some-State, C=AU</X509IssuerName>
> <X509SerialNumber>2</X509SerialNumber>
> </X509IssuerSerial>
> </X509Data>
> </o:SecurityTokenReference>
> </KeyInfo>
> </Signature>
> </saml:Assertion>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
[jira] [Commented] (WSS-394) WSS4J is not handling X509Data inside
SecurityTokenReference inside a KeyInfo
Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WSS-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294916#comment-13294916 ]
Colm O hEigeartaigh commented on WSS-394:
-----------------------------------------
I've committed a potential fix for this issue. Could you grab the latest 1.6.7-SNAPSHOT code and let me know if it works or not?
Colm.
> WSS4J is not handling X509Data inside SecurityTokenReference inside a KeyInfo
> -----------------------------------------------------------------------------
>
> Key: WSS-394
> URL: https://issues.apache.org/jira/browse/WSS-394
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 1.6.6
> Environment: .NET client, .NET STS, Java service, Windows 7.0
> Reporter: Dan Taylor
> Assignee: Colm O hEigeartaigh
> Labels: KeyInfo, SecurityTokenReference, X509Data
> Fix For: 1.6.7
>
>
> We have a .NET client using a .NET STS for authentication and authorization to our java service. The .NET STS puts a SecurityTokenReference inside a KeyInfo element, with an X509Data inside the STR. This causes an exception to be thrown: General security error (SAML token security failure).
> From debugging into the WSS4J source in the SAMLUtil.getCredentialFromKeyInfo method, keyInfoElement.getFirstChild() returns the SecurityTokenReference element. Inside this element is the X509Data element, which should be handled correctly..
> From the WS-Security 1.1 (Web Services Security: SOAP Message Security 1.1) standard:
> Section 7.1: “All compliant implementations MUST be able to process a <wsse:SecurityTokenReference> element. This element can also be used as a direct child element of <ds:KeyInfo> to indicate a hint to retrieve the key information from a security token placed somewhere else. In particular, it is RECOMMENDED, when using XML Signature and XML Encryption, that a <wsse:SecurityTokenReference> element be placed inside a <ds:KeyInfo> to reference the security token used for the signature or encryption.”
> From the Web Services Security X.509 Certificate Token Profile 1.1) standard:
> Section 3.2: “In order to ensure a consistent processing model across all the token types supported by WSS: SOAP Message Security, the <wsse:SecurityTokenReference> element SHALL be used to specify all references to X.509 token types in signature or encryption elements that comply with this profile.”
> Sample SAMLToken:
> <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981" Issuer="sts" IssueInstant="2012-06-12T15:25:49.393Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
> <saml:Conditions NotBefore="2012-06-12T15:25:49.393Z" NotOnOrAfter="2012-06-13T01:25:49.393Z"></saml:Conditions>
> <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2012-06-12T15:25:49.397Z">
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> </saml:AuthenticationStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="roles" AttributeNamespace="http://schemas.merge.com/icc/claims">
> <saml:AttributeValue>User</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>test@merge.com</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="privatepersonalidentitfier" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>55</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
> <Reference URI="#SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981">
> <Transforms>
> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValue>P0aIAqKPikgPXLn4TfcF1z5ZmZo=</DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValue>fGTlN2CXzqSsdLS8pH4r3gqmwGTo40uqSvnioMd6bl/PdgAgLw0OtirVZFofVEQWQXY1yuGjzOX0w7CeyfjprOHf/bLphoem1oyjJe+QDCtKA41faXhXbJOEtbksdxqui+qU+YwqStbJJmi/F9yijjuwnuwbDhI48SqcdmZcsY8=</SignatureValue>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <X509Data>
> <X509IssuerSerial>
> <X509IssuerName>CN=SUNCA, OU=JWS, O=SUN, S=Some-State, C=AU</X509IssuerName>
> <X509SerialNumber>2</X509SerialNumber>
> </X509IssuerSerial>
> </X509Data>
> </o:SecurityTokenReference>
> </KeyInfo>
> </Signature>
> </saml:Assertion>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
[jira] [Commented] (WSS-394) WSS4J is not handling X509Data inside
SecurityTokenReference inside a KeyInfo
Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WSS-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13397386#comment-13397386 ]
Colm O hEigeartaigh commented on WSS-394:
-----------------------------------------
Hi Dan,
I'm not seeing this error when I copy & paste the SAML Assertion above into a file and process it via the SAMLTokenProcessor. It's processing the KeyInfo correctly, but is failing locally as I don't have the referenced certificate.
Could you check to make sure you're using an up-to-date 1.6.7-SNAPSHOT jar? Failing that, could you let me know what path the code is taking in SAMLUtil.getCredentialFromKeyInfo()? Is it entering into the "else if (SecurityTokenReference.STR_QNAME.equals(el)) {" block?
Colm.
> WSS4J is not handling X509Data inside SecurityTokenReference inside a KeyInfo
> -----------------------------------------------------------------------------
>
> Key: WSS-394
> URL: https://issues.apache.org/jira/browse/WSS-394
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 1.6.6
> Environment: .NET client, .NET STS, Java service, Windows 7.0
> Reporter: Dan Taylor
> Assignee: Colm O hEigeartaigh
> Labels: KeyInfo, SecurityTokenReference, X509Data
> Fix For: 1.6.7
>
>
> We have a .NET client using a .NET STS for authentication and authorization to our java service. The .NET STS puts a SecurityTokenReference inside a KeyInfo element, with an X509Data inside the STR. This causes an exception to be thrown: General security error (SAML token security failure).
> From debugging into the WSS4J source in the SAMLUtil.getCredentialFromKeyInfo method, keyInfoElement.getFirstChild() returns the SecurityTokenReference element. Inside this element is the X509Data element, which should be handled correctly..
> From the WS-Security 1.1 (Web Services Security: SOAP Message Security 1.1) standard:
> Section 7.1: “All compliant implementations MUST be able to process a <wsse:SecurityTokenReference> element. This element can also be used as a direct child element of <ds:KeyInfo> to indicate a hint to retrieve the key information from a security token placed somewhere else. In particular, it is RECOMMENDED, when using XML Signature and XML Encryption, that a <wsse:SecurityTokenReference> element be placed inside a <ds:KeyInfo> to reference the security token used for the signature or encryption.”
> From the Web Services Security X.509 Certificate Token Profile 1.1) standard:
> Section 3.2: “In order to ensure a consistent processing model across all the token types supported by WSS: SOAP Message Security, the <wsse:SecurityTokenReference> element SHALL be used to specify all references to X.509 token types in signature or encryption elements that comply with this profile.”
> Sample SAMLToken:
> <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981" Issuer="sts" IssueInstant="2012-06-12T15:25:49.393Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
> <saml:Conditions NotBefore="2012-06-12T15:25:49.393Z" NotOnOrAfter="2012-06-13T01:25:49.393Z"></saml:Conditions>
> <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2012-06-12T15:25:49.397Z">
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> </saml:AuthenticationStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="roles" AttributeNamespace="http://schemas.merge.com/icc/claims">
> <saml:AttributeValue>User</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>test@merge.com</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="privatepersonalidentitfier" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>55</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
> <Reference URI="#SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981">
> <Transforms>
> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValue>P0aIAqKPikgPXLn4TfcF1z5ZmZo=</DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValue>fGTlN2CXzqSsdLS8pH4r3gqmwGTo40uqSvnioMd6bl/PdgAgLw0OtirVZFofVEQWQXY1yuGjzOX0w7CeyfjprOHf/bLphoem1oyjJe+QDCtKA41faXhXbJOEtbksdxqui+qU+YwqStbJJmi/F9yijjuwnuwbDhI48SqcdmZcsY8=</SignatureValue>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <X509Data>
> <X509IssuerSerial>
> <X509IssuerName>CN=SUNCA, OU=JWS, O=SUN, S=Some-State, C=AU</X509IssuerName>
> <X509SerialNumber>2</X509SerialNumber>
> </X509IssuerSerial>
> </X509Data>
> </o:SecurityTokenReference>
> </KeyInfo>
> </Signature>
> </saml:Assertion>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
[jira] [Commented] (WSS-394) WSS4J is not handling X509Data inside
SecurityTokenReference inside a KeyInfo
Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WSS-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13397393#comment-13397393 ]
Colm O hEigeartaigh commented on WSS-394:
-----------------------------------------
Actually, I've just noticed that the Jenkins build failed when building the commit I made for this issue, so you were likely testing against an older SNAPSHOT jar. I've re-built it, and so a more up-to-date jar should be available here shortly:
https://repository.apache.org/content/groups/snapshots/org/apache/ws/security/wss4j/1.6.7-SNAPSHOT/
Could you let me know if this works?
Colm.
> WSS4J is not handling X509Data inside SecurityTokenReference inside a KeyInfo
> -----------------------------------------------------------------------------
>
> Key: WSS-394
> URL: https://issues.apache.org/jira/browse/WSS-394
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 1.6.6
> Environment: .NET client, .NET STS, Java service, Windows 7.0
> Reporter: Dan Taylor
> Assignee: Colm O hEigeartaigh
> Labels: KeyInfo, SecurityTokenReference, X509Data
> Fix For: 1.6.7
>
>
> We have a .NET client using a .NET STS for authentication and authorization to our java service. The .NET STS puts a SecurityTokenReference inside a KeyInfo element, with an X509Data inside the STR. This causes an exception to be thrown: General security error (SAML token security failure).
> From debugging into the WSS4J source in the SAMLUtil.getCredentialFromKeyInfo method, keyInfoElement.getFirstChild() returns the SecurityTokenReference element. Inside this element is the X509Data element, which should be handled correctly..
> From the WS-Security 1.1 (Web Services Security: SOAP Message Security 1.1) standard:
> Section 7.1: “All compliant implementations MUST be able to process a <wsse:SecurityTokenReference> element. This element can also be used as a direct child element of <ds:KeyInfo> to indicate a hint to retrieve the key information from a security token placed somewhere else. In particular, it is RECOMMENDED, when using XML Signature and XML Encryption, that a <wsse:SecurityTokenReference> element be placed inside a <ds:KeyInfo> to reference the security token used for the signature or encryption.”
> From the Web Services Security X.509 Certificate Token Profile 1.1) standard:
> Section 3.2: “In order to ensure a consistent processing model across all the token types supported by WSS: SOAP Message Security, the <wsse:SecurityTokenReference> element SHALL be used to specify all references to X.509 token types in signature or encryption elements that comply with this profile.”
> Sample SAMLToken:
> <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981" Issuer="sts" IssueInstant="2012-06-12T15:25:49.393Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
> <saml:Conditions NotBefore="2012-06-12T15:25:49.393Z" NotOnOrAfter="2012-06-13T01:25:49.393Z"></saml:Conditions>
> <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2012-06-12T15:25:49.397Z">
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> </saml:AuthenticationStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="roles" AttributeNamespace="http://schemas.merge.com/icc/claims">
> <saml:AttributeValue>User</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>test@merge.com</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="privatepersonalidentitfier" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>55</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
> <Reference URI="#SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981">
> <Transforms>
> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValue>P0aIAqKPikgPXLn4TfcF1z5ZmZo=</DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValue>fGTlN2CXzqSsdLS8pH4r3gqmwGTo40uqSvnioMd6bl/PdgAgLw0OtirVZFofVEQWQXY1yuGjzOX0w7CeyfjprOHf/bLphoem1oyjJe+QDCtKA41faXhXbJOEtbksdxqui+qU+YwqStbJJmi/F9yijjuwnuwbDhI48SqcdmZcsY8=</SignatureValue>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <X509Data>
> <X509IssuerSerial>
> <X509IssuerName>CN=SUNCA, OU=JWS, O=SUN, S=Some-State, C=AU</X509IssuerName>
> <X509SerialNumber>2</X509SerialNumber>
> </X509IssuerSerial>
> </X509Data>
> </o:SecurityTokenReference>
> </KeyInfo>
> </Signature>
> </saml:Assertion>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
[jira] [Commented] (WSS-394) WSS4J is not handling X509Data inside
SecurityTokenReference inside a KeyInfo
Posted by "Dan Taylor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WSS-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13397633#comment-13397633 ]
Dan Taylor commented on WSS-394:
--------------------------------
Hi Colm,
The newest update works perfectly. Thank you for your help, greatly appreciated.
Dan.
> WSS4J is not handling X509Data inside SecurityTokenReference inside a KeyInfo
> -----------------------------------------------------------------------------
>
> Key: WSS-394
> URL: https://issues.apache.org/jira/browse/WSS-394
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 1.6.6
> Environment: .NET client, .NET STS, Java service, Windows 7.0
> Reporter: Dan Taylor
> Assignee: Colm O hEigeartaigh
> Labels: KeyInfo, SecurityTokenReference, X509Data
> Fix For: 1.6.7
>
>
> We have a .NET client using a .NET STS for authentication and authorization to our java service. The .NET STS puts a SecurityTokenReference inside a KeyInfo element, with an X509Data inside the STR. This causes an exception to be thrown: General security error (SAML token security failure).
> From debugging into the WSS4J source in the SAMLUtil.getCredentialFromKeyInfo method, keyInfoElement.getFirstChild() returns the SecurityTokenReference element. Inside this element is the X509Data element, which should be handled correctly..
> From the WS-Security 1.1 (Web Services Security: SOAP Message Security 1.1) standard:
> Section 7.1: “All compliant implementations MUST be able to process a <wsse:SecurityTokenReference> element. This element can also be used as a direct child element of <ds:KeyInfo> to indicate a hint to retrieve the key information from a security token placed somewhere else. In particular, it is RECOMMENDED, when using XML Signature and XML Encryption, that a <wsse:SecurityTokenReference> element be placed inside a <ds:KeyInfo> to reference the security token used for the signature or encryption.”
> From the Web Services Security X.509 Certificate Token Profile 1.1) standard:
> Section 3.2: “In order to ensure a consistent processing model across all the token types supported by WSS: SOAP Message Security, the <wsse:SecurityTokenReference> element SHALL be used to specify all references to X.509 token types in signature or encryption elements that comply with this profile.”
> Sample SAMLToken:
> <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981" Issuer="sts" IssueInstant="2012-06-12T15:25:49.393Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
> <saml:Conditions NotBefore="2012-06-12T15:25:49.393Z" NotOnOrAfter="2012-06-13T01:25:49.393Z"></saml:Conditions>
> <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2012-06-12T15:25:49.397Z">
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> </saml:AuthenticationStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="roles" AttributeNamespace="http://schemas.merge.com/icc/claims">
> <saml:AttributeValue>User</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>test@merge.com</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="privatepersonalidentitfier" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>55</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
> <Reference URI="#SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981">
> <Transforms>
> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValue>P0aIAqKPikgPXLn4TfcF1z5ZmZo=</DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValue>fGTlN2CXzqSsdLS8pH4r3gqmwGTo40uqSvnioMd6bl/PdgAgLw0OtirVZFofVEQWQXY1yuGjzOX0w7CeyfjprOHf/bLphoem1oyjJe+QDCtKA41faXhXbJOEtbksdxqui+qU+YwqStbJJmi/F9yijjuwnuwbDhI48SqcdmZcsY8=</SignatureValue>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <X509Data>
> <X509IssuerSerial>
> <X509IssuerName>CN=SUNCA, OU=JWS, O=SUN, S=Some-State, C=AU</X509IssuerName>
> <X509SerialNumber>2</X509SerialNumber>
> </X509IssuerSerial>
> </X509Data>
> </o:SecurityTokenReference>
> </KeyInfo>
> </Signature>
> </saml:Assertion>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
[jira] [Resolved] (WSS-394) WSS4J is not handling X509Data inside
SecurityTokenReference inside a KeyInfo
Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WSS-394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Colm O hEigeartaigh resolved WSS-394.
-------------------------------------
Resolution: Fixed
> WSS4J is not handling X509Data inside SecurityTokenReference inside a KeyInfo
> -----------------------------------------------------------------------------
>
> Key: WSS-394
> URL: https://issues.apache.org/jira/browse/WSS-394
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 1.6.6
> Environment: .NET client, .NET STS, Java service, Windows 7.0
> Reporter: Dan Taylor
> Assignee: Colm O hEigeartaigh
> Labels: KeyInfo, SecurityTokenReference, X509Data
> Fix For: 1.6.7
>
>
> We have a .NET client using a .NET STS for authentication and authorization to our java service. The .NET STS puts a SecurityTokenReference inside a KeyInfo element, with an X509Data inside the STR. This causes an exception to be thrown: General security error (SAML token security failure).
> From debugging into the WSS4J source in the SAMLUtil.getCredentialFromKeyInfo method, keyInfoElement.getFirstChild() returns the SecurityTokenReference element. Inside this element is the X509Data element, which should be handled correctly..
> From the WS-Security 1.1 (Web Services Security: SOAP Message Security 1.1) standard:
> Section 7.1: “All compliant implementations MUST be able to process a <wsse:SecurityTokenReference> element. This element can also be used as a direct child element of <ds:KeyInfo> to indicate a hint to retrieve the key information from a security token placed somewhere else. In particular, it is RECOMMENDED, when using XML Signature and XML Encryption, that a <wsse:SecurityTokenReference> element be placed inside a <ds:KeyInfo> to reference the security token used for the signature or encryption.”
> From the Web Services Security X.509 Certificate Token Profile 1.1) standard:
> Section 3.2: “In order to ensure a consistent processing model across all the token types supported by WSS: SOAP Message Security, the <wsse:SecurityTokenReference> element SHALL be used to specify all references to X.509 token types in signature or encryption elements that comply with this profile.”
> Sample SAMLToken:
> <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981" Issuer="sts" IssueInstant="2012-06-12T15:25:49.393Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
> <saml:Conditions NotBefore="2012-06-12T15:25:49.393Z" NotOnOrAfter="2012-06-13T01:25:49.393Z"></saml:Conditions>
> <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2012-06-12T15:25:49.397Z">
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> </saml:AuthenticationStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="roles" AttributeNamespace="http://schemas.merge.com/icc/claims">
> <saml:AttributeValue>User</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>test@merge.com</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="privatepersonalidentitfier" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>55</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
> <Reference URI="#SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981">
> <Transforms>
> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValue>P0aIAqKPikgPXLn4TfcF1z5ZmZo=</DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValue>fGTlN2CXzqSsdLS8pH4r3gqmwGTo40uqSvnioMd6bl/PdgAgLw0OtirVZFofVEQWQXY1yuGjzOX0w7CeyfjprOHf/bLphoem1oyjJe+QDCtKA41faXhXbJOEtbksdxqui+qU+YwqStbJJmi/F9yijjuwnuwbDhI48SqcdmZcsY8=</SignatureValue>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <X509Data>
> <X509IssuerSerial>
> <X509IssuerName>CN=SUNCA, OU=JWS, O=SUN, S=Some-State, C=AU</X509IssuerName>
> <X509SerialNumber>2</X509SerialNumber>
> </X509IssuerSerial>
> </X509Data>
> </o:SecurityTokenReference>
> </KeyInfo>
> </Signature>
> </saml:Assertion>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
[jira] [Commented] (WSS-394) WSS4J is not handling X509Data inside
SecurityTokenReference inside a KeyInfo
Posted by "Dan Taylor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WSS-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295859#comment-13295859 ]
Dan Taylor commented on WSS-394:
--------------------------------
Hi Colm,
>From our testing, this didn't actually make a difference to the service. We will debug into this either later today (Friday) or on Monday and provide more details about what is failing.
Thanks,
Dan.
> WSS4J is not handling X509Data inside SecurityTokenReference inside a KeyInfo
> -----------------------------------------------------------------------------
>
> Key: WSS-394
> URL: https://issues.apache.org/jira/browse/WSS-394
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 1.6.6
> Environment: .NET client, .NET STS, Java service, Windows 7.0
> Reporter: Dan Taylor
> Assignee: Colm O hEigeartaigh
> Labels: KeyInfo, SecurityTokenReference, X509Data
> Fix For: 1.6.7
>
>
> We have a .NET client using a .NET STS for authentication and authorization to our java service. The .NET STS puts a SecurityTokenReference inside a KeyInfo element, with an X509Data inside the STR. This causes an exception to be thrown: General security error (SAML token security failure).
> From debugging into the WSS4J source in the SAMLUtil.getCredentialFromKeyInfo method, keyInfoElement.getFirstChild() returns the SecurityTokenReference element. Inside this element is the X509Data element, which should be handled correctly..
> From the WS-Security 1.1 (Web Services Security: SOAP Message Security 1.1) standard:
> Section 7.1: “All compliant implementations MUST be able to process a <wsse:SecurityTokenReference> element. This element can also be used as a direct child element of <ds:KeyInfo> to indicate a hint to retrieve the key information from a security token placed somewhere else. In particular, it is RECOMMENDED, when using XML Signature and XML Encryption, that a <wsse:SecurityTokenReference> element be placed inside a <ds:KeyInfo> to reference the security token used for the signature or encryption.”
> From the Web Services Security X.509 Certificate Token Profile 1.1) standard:
> Section 3.2: “In order to ensure a consistent processing model across all the token types supported by WSS: SOAP Message Security, the <wsse:SecurityTokenReference> element SHALL be used to specify all references to X.509 token types in signature or encryption elements that comply with this profile.”
> Sample SAMLToken:
> <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981" Issuer="sts" IssueInstant="2012-06-12T15:25:49.393Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
> <saml:Conditions NotBefore="2012-06-12T15:25:49.393Z" NotOnOrAfter="2012-06-13T01:25:49.393Z"></saml:Conditions>
> <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2012-06-12T15:25:49.397Z">
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> </saml:AuthenticationStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="roles" AttributeNamespace="http://schemas.merge.com/icc/claims">
> <saml:AttributeValue>User</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>test@merge.com</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="privatepersonalidentitfier" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>55</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
> <Reference URI="#SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981">
> <Transforms>
> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValue>P0aIAqKPikgPXLn4TfcF1z5ZmZo=</DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValue>fGTlN2CXzqSsdLS8pH4r3gqmwGTo40uqSvnioMd6bl/PdgAgLw0OtirVZFofVEQWQXY1yuGjzOX0w7CeyfjprOHf/bLphoem1oyjJe+QDCtKA41faXhXbJOEtbksdxqui+qU+YwqStbJJmi/F9yijjuwnuwbDhI48SqcdmZcsY8=</SignatureValue>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <X509Data>
> <X509IssuerSerial>
> <X509IssuerName>CN=SUNCA, OU=JWS, O=SUN, S=Some-State, C=AU</X509IssuerName>
> <X509SerialNumber>2</X509SerialNumber>
> </X509IssuerSerial>
> </X509Data>
> </o:SecurityTokenReference>
> </KeyInfo>
> </Signature>
> </saml:Assertion>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
[jira] [Closed] (WSS-394) WSS4J is not handling X509Data inside
SecurityTokenReference inside a KeyInfo
Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WSS-394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Colm O hEigeartaigh closed WSS-394.
-----------------------------------
> WSS4J is not handling X509Data inside SecurityTokenReference inside a KeyInfo
> -----------------------------------------------------------------------------
>
> Key: WSS-394
> URL: https://issues.apache.org/jira/browse/WSS-394
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 1.6.6
> Environment: .NET client, .NET STS, Java service, Windows 7.0
> Reporter: Dan Taylor
> Assignee: Colm O hEigeartaigh
> Labels: KeyInfo, SecurityTokenReference, X509Data
> Fix For: 1.6.7
>
>
> We have a .NET client using a .NET STS for authentication and authorization to our java service. The .NET STS puts a SecurityTokenReference inside a KeyInfo element, with an X509Data inside the STR. This causes an exception to be thrown: General security error (SAML token security failure).
> From debugging into the WSS4J source in the SAMLUtil.getCredentialFromKeyInfo method, keyInfoElement.getFirstChild() returns the SecurityTokenReference element. Inside this element is the X509Data element, which should be handled correctly..
> From the WS-Security 1.1 (Web Services Security: SOAP Message Security 1.1) standard:
> Section 7.1: “All compliant implementations MUST be able to process a <wsse:SecurityTokenReference> element. This element can also be used as a direct child element of <ds:KeyInfo> to indicate a hint to retrieve the key information from a security token placed somewhere else. In particular, it is RECOMMENDED, when using XML Signature and XML Encryption, that a <wsse:SecurityTokenReference> element be placed inside a <ds:KeyInfo> to reference the security token used for the signature or encryption.”
> From the Web Services Security X.509 Certificate Token Profile 1.1) standard:
> Section 3.2: “In order to ensure a consistent processing model across all the token types supported by WSS: SOAP Message Security, the <wsse:SecurityTokenReference> element SHALL be used to specify all references to X.509 token types in signature or encryption elements that comply with this profile.”
> Sample SAMLToken:
> <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981" Issuer="sts" IssueInstant="2012-06-12T15:25:49.393Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
> <saml:Conditions NotBefore="2012-06-12T15:25:49.393Z" NotOnOrAfter="2012-06-13T01:25:49.393Z"></saml:Conditions>
> <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2012-06-12T15:25:49.397Z">
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> </saml:AuthenticationStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="roles" AttributeNamespace="http://schemas.merge.com/icc/claims">
> <saml:AttributeValue>User</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>test@merge.com</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <saml:AttributeStatement>
> <saml:Subject>
> <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName">test@merge.com</saml:NameIdentifier>
> <saml:SubjectConfirmation>
> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
> <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> </e:EncryptionMethod>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">TzX5OGaS9Ftsw1t+eGyfBmJblWc=</o:KeyIdentifier>
> </o:SecurityTokenReference>
> </KeyInfo>
> <e:CipherData>
> <e:CipherValue>LUoFbgeoVCjiW+xZxlOly2YtVbtK3a0ZDw0cpZAKyO9smgEcg5gf2bYzPurU6Khp3PHfKJJv0yIJP010v+qe80KTMOhxJ6EF8NKbg+rUXhKh1aFV1gDSECR6KiVoHmsfkzoJGvi2wG4QA6lyaUJ7FGFE/2udn/MOTocezqX2bpg=</e:CipherValue>
> </e:CipherData>
> </e:EncryptedKey>
> </KeyInfo>
> </saml:SubjectConfirmation>
> </saml:Subject>
> <saml:Attribute AttributeName="privatepersonalidentitfier" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
> <saml:AttributeValue>55</saml:AttributeValue>
> </saml:Attribute>
> </saml:AttributeStatement>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
> <Reference URI="#SamlSecurityToken-db75ab81-fbe4-455b-ad51-99ff091f3981">
> <Transforms>
> <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValue>P0aIAqKPikgPXLn4TfcF1z5ZmZo=</DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValue>fGTlN2CXzqSsdLS8pH4r3gqmwGTo40uqSvnioMd6bl/PdgAgLw0OtirVZFofVEQWQXY1yuGjzOX0w7CeyfjprOHf/bLphoem1oyjJe+QDCtKA41faXhXbJOEtbksdxqui+qU+YwqStbJJmi/F9yijjuwnuwbDhI48SqcdmZcsY8=</SignatureValue>
> <KeyInfo>
> <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
> <X509Data>
> <X509IssuerSerial>
> <X509IssuerName>CN=SUNCA, OU=JWS, O=SUN, S=Some-State, C=AU</X509IssuerName>
> <X509SerialNumber>2</X509SerialNumber>
> </X509IssuerSerial>
> </X509Data>
> </o:SecurityTokenReference>
> </KeyInfo>
> </Signature>
> </saml:Assertion>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org