IBM Support

Steps to add User name Token and Password under the WS Security header of a SOAP Request.

Technical Blog Post


Abstract

Steps to add User name Token and Password under the WS Security header of a SOAP Request.

Body

Follow the below steps to create a user name token and password
1. Create a User Name Token, from the Deployment -> Web Services -> Security Tokens, page.

image

2. Click on Create Security Token. Enter the user token name, description and choose token type as user name.

image

3. Click Next, enter the User name and password. Enable digest if you want the password to be digested.

image

4. Click Next and click on Finish. You can now see the security Token with User Name - admin being created.

image

Follow the below steps to pass the user name token in security headers of the SOAP request.
1. You might have designed a BP with below steps to Consume the webservice from Sterling Integrator
DynamicService -> SOAOutboundSecurity Service -> SOAOutboundMessageProcessingService -> HTTP Begin, Post and End Services -> SOAInboundMessageProcessingService -> SOAInboundSecurityService
2. In order to pass the user name token under the security headers, add the below assign statements in the <Output message> section of the SOAOutboundSecurity Service in addition to other parameters used for signing and encryption.
<assign to="INSERT_USER_NAME_TOKEN">True</assign>
<assign to="USER_NAME_TOKEN_NAME">admin</assign>
For example:
<operation name="SOAOutboundSecurityService">
<participant name="SOAOutboundSecurityService_Instance"/>
<output message="SOAOutboundSecurityServiceInputMessage">
<assign to="CANONICALIZATION_ALGO">http://www.w3.org/2001/10/xml-exc-c14n#</assign&gt;
<assign to="ENCRYPT_KEY_IDENTIFIER_TYPE">1</assign>
<assign to="ENCRYPTION_CERTIFICATE">12345node1</assign>
<assign to="INSERT_TIME_STAMPS">True</assign>
<assign to="SIGNATURE_ENCRYPTION_ORDER">1</assign>
<assign to="SIGNING_CERTIFICATE">4567node1</assign>
<assign to="SIGNING_KEY_IDENTIFIER_TYPE">1</assign>
<assign to="INSERT_USER_NAME_TOKEN">True</assign>
<assign to="USER_NAME_TOKEN_NAME">admin</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
3. Execute the Business Process designed to consume the webservice. After execution you can see that in the SOAOutboundSecurityService, there is a SOAP request with security headers consisting of username token and password as below

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11121931