You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Colm O hEigeartaigh <co...@apache.org> on 2017/08/01 09:31:09 UTC
Re: [STS] How to handle BinarySecurityToken when it's not as expected?
I could modify the logic just to process the BinarySecurityToken and store
it on the context. What is the expected behaviour of the STS for this
request? How should it interpret that BinarySecurityToken? Are you plugging
in a custom TokenProvider to support whatever the requested token format is?
Colm.
On Mon, Jul 31, 2017 at 3:23 PM, NicholaiX <in...@gmail.com>
wrote:
> They are not exactly duplicates, they differ in the payload. The one in the
> body contains a certificate.
>
> These are payloads sent by windows, and as such I have no control over
> their
> definition. The payload example is here:
>
> https://msdn.microsoft.com/en-us/library/dn366934.aspx
>
> The two BinarySecurityToken objects are defined here:
>
> https://msdn.microsoft.com/en-us/library/dn410740.aspx
>
> To quote:
>
> Authentication MUST be implemented for this message as defined in section
> 3.4. In summary, the following elements and attributes MUST be specified in
> the SOAP header:
> wsse:Security: The <wsse:Security> element MUST be a child of <s:Header>.
> wsse:BinarySecurityToken: The <wsse:BinarySecurityToken> element MUST be a
> child of <wsse:Security> in <s:Header>.
> wsse:BinarySecurityToken/attributes/ValueType: The
> <wsse:BinarySecurityToken> ValueType attribute MUST be
> "http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/
> DeviceEnrollmentUserToken".
> wsse:BinarySecurityToken/attributes/EncodingType: The
> <wsse:BinarySecurityToken> EncodingType attribute MUST be
> "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-
> wssecurity-secext-1.0.xsd#base64binary".
> The following elements and attributes MUST be specified in the SOAP body of
> the request message.
> wst:RequestSecurityToken: The <wst:RequestSecurityToken> element MUST be a
> child of <s:Body>.
> wst:RequestType: The <wst:RequestType> element MUST be a child of
> <wst:RequestSecurityToken> and the value MUST be
> "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue" (see [WSTrust1.3]
> section 3.1).
> wst:TokenType: The <wst:tokentype> element MUST be a child of
> <wst:RequestSecurityToken> and the value MUST be
> "http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/
> Enrollment/DeviceEnrollmentToken" (see [WSTrust1.3] section 3.1).
> wsse:BinarySecurityToken: The <wsse:BinarySecurityToken> element MUST be a
> child of <wst:RequestSecurityToken> and MUST contain a base64-encoded
> certificate signing request.
> wsse:BinarySecurityToken/attributes/ValueType: The
> <wsse:BinarySecurityToken> ValueType attribute MUST be
> "http://schemas.microsoft.com/windows/pki/2009/01/ enrollment#PKCS10".
> wsse:BinarySecurityToken/attributes/EncodingType: The
> <wsse:BinarySecurityToken> EncodingType attribute MUST be
> "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-
> wssecurity-secext-1.0.xsd#base64binary".
> ac:AdditionalContext: The <ac:AdditionalContext> element MUST be a child of
> <wst:RequestSecurityToken> (see [MS-WSTEP] section 3.1.4.1.3.3).
> ac:ContextItem: One or more <ac:ContextItem> elements MUST be specified as
> child elements of <ac:AdditionalContext> to represent the device type.
> ac:ContextItem/attributes/Name: The <ac:ContextItem> Name attribute MUST
> be
> the literal string "DeviceType".
> ac:Value: The <ac:Value> element MUST be a child of <ac:AdditionalContext>
> and the value MUST be CIMClient_Windows.
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/STS-How-to-handle-BinarySecurityToken-when-it-s-not-as-expected-
> tp5782018p5782247.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
--
Colm O hEigeartaigh
Talend Community Coder
http://coders.talend.com
Re: [STS] How to handle BinarySecurityToken when it's not as expected?
Posted by Colm O hEigeartaigh <co...@apache.org>.
We normally release every 2 months or so, so you could expect the next CXF
3.1.x release at the end of August. I think CXF 3.2.0 will happen soon as
well, but I can't offer any guarantees on that.
Colm.
On Fri, Aug 4, 2017 at 12:28 AM, NicholaiX <in...@gmail.com>
wrote:
> Thank you, it worked well for me, much appreciated.
>
> Since I pulled 3.2, this means that the JAXBelements and DOMElements will
> all be in one list, correct? (I was confused by that until I read the
> commend indicating the two lists is only a 3.1 artifact)
>
> How do I know when this fix will be released in 3.1 vs 3.2, to determine
> which version I should focus on? I have not managed to find the release
> plans, and JIRA has both branches with release date as "Not Set"
>
> Again thank you!
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/STS-How-to-handle-BinarySecurityToken-when-it-s-not-as-expected-
> tp5782018p5782405.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
--
Colm O hEigeartaigh
Talend Community Coder
http://coders.talend.com
Re: [STS] How to handle BinarySecurityToken when it's not as
expected?
Posted by NicholaiX <in...@gmail.com>.
Thank you, it worked well for me, much appreciated.
Since I pulled 3.2, this means that the JAXBelements and DOMElements will
all be in one list, correct? (I was confused by that until I read the
commend indicating the two lists is only a 3.1 artifact)
How do I know when this fix will be released in 3.1 vs 3.2, to determine
which version I should focus on? I have not managed to find the release
plans, and JIRA has both branches with release date as "Not Set"
Again thank you!
--
View this message in context: http://cxf.547215.n5.nabble.com/STS-How-to-handle-BinarySecurityToken-when-it-s-not-as-expected-tp5782018p5782405.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: [STS] How to handle BinarySecurityToken when it's not as expected?
Posted by Colm O hEigeartaigh <co...@apache.org>.
There is a boolean called "allowCustomContent" that you can set on the
AbstractOperation:
https://github.com/apache/cxf/blob/master/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java#L107
Up to now it only supported DOM Elements. I've updated the code to allow
JAXBElements as well. So if you grab the latest SNAPSHOT code for 3.2 or
3.1, and set that boolean, you will have access to the custom content in
this class:
https://github.com/apache/cxf/blob/master/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/TokenRequirements.java#L48
For backwards compatibility reasons, in 3.1.x there will be two lists, one
containing the custom DOM Elements parsed, and the other the custom JAXB
Elements. Then you need to write a TokenProvider to understand the
requested TokenType, which is not supported by default in CXF.
Colm.
On Tue, Aug 1, 2017 at 3:51 PM, NicholaiX <in...@gmail.com>
wrote:
> At this point, I just need access to the BST inside the RST and forward it
> to
> a certificate issuer so it can issue me a certificate. I also need access
> to
> the AdditionalContext inside the RST (My request to the issuer needs to
> contain both items)
>
> I haven't written the code yet since I didn't get past the BST hurdle, so
> I
> don't know how the implementation will go, I am open to any approach. I
> don't see why it couldn't be a custom tokenprovider, assuming I can hand
> off
> both the BST and the additonalcontext. But since the BST and the
> additionalcontext inside the RST are peers not parent/child, would that
> work?
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/STS-How-to-handle-BinarySecurityToken-when-it-s-not-as-expected-
> tp5782018p5782271.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
--
Colm O hEigeartaigh
Talend Community Coder
http://coders.talend.com
Re: [STS] How to handle BinarySecurityToken when it's not as
expected?
Posted by NicholaiX <in...@gmail.com>.
At this point, I just need access to the BST inside the RST and forward it to
a certificate issuer so it can issue me a certificate. I also need access to
the AdditionalContext inside the RST (My request to the issuer needs to
contain both items)
I haven't written the code yet since I didn't get past the BST hurdle, so I
don't know how the implementation will go, I am open to any approach. I
don't see why it couldn't be a custom tokenprovider, assuming I can hand off
both the BST and the additonalcontext. But since the BST and the
additionalcontext inside the RST are peers not parent/child, would that
work?
--
View this message in context: http://cxf.547215.n5.nabble.com/STS-How-to-handle-BinarySecurityToken-when-it-s-not-as-expected-tp5782018p5782271.html
Sent from the cxf-user mailing list archive at Nabble.com.