When you are inserting the SAML token, do you also need to create it, or is
it obtained from a third-party (e.g. STS)? SAML tokens are included in the
security header of a SOAP request. With CXF you can use either
WS-SecurityPolicy or else manually configure WSS4J to add a SAML Token. In
either case, to create a SAML Token you use a special CallbackHandler
implementation that populates a set of beans with the required information,
and WSS4J takes care of parsing the beans + creating + inserting a SAML
Assertion.

Here is an example about how to use WS-SecurityPolicy with CXF to create a
SAML Token:

https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=tree;f=systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml;h=316f3caa0e7cdb39e401ea273c47462011a0edaf;hb=refs/heads/2.7.x-fixes

If you already have a SAML Token as a DOM Element, you can set this on the
SAMLCallback Object in the CallbackHandler instead.

If you are not using WS-SecurityPolicy, you need to set up the
WSS4JOutInterceptor with the "actions" of either "SAMLTokenUnsigned" or
"SAMLTokenSigned" + specify a CallbackHandler to create/retrieve the
assertion. Here is a spring example (bottom client):

https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=blob;f=systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client/client.xml;h=e0cac1dfe57bbfd2a89e250777cd68316da2aeb6;hb=refs/heads/2.7.x-fixes

There are not any tests that I am aware of in Camel itself showing how to
add SAML Tokens with camel-cxf. If you are having any difficulties let me
know + I will add some.

Colm.


On Sat, Mar 29, 2014 at 4:37 AM, chaij <jin.c...@indigoarc.com> wrote:

> I need to insert a SAML token (xml) to the outgoing SOAP request and
> process
> the incoming SAML token as well.
>
> How can I achieve this?
>
> I am using camel cxf.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/add-SAML-TOKEN-to-SOAP-header-tp5749520.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Reply via email to