https://raw.githubusercontent.com/ajmaradiaga/feeds/main/scmt/topics/Cloud-Integration-blog-posts.xml SAP Community - Cloud Integration 2024-05-10T08:00:09.847318+00:00 python-feedgen Cloud Integration blog posts in SAP Community https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-4-iflow/ba-p/13647065 Cloud Integration: AMQP Adapter, Client Certificate, Solace PubSub+ [4]: iFlow 2024-03-25T12:29:22.712000+01:00 CarlosRoggan https://community.sap.com/t5/user/viewprofilepage/user-id/5495 <P><STRONG>SAP Cloud Integration</STRONG> (aka CPI) allows to send messages from an iFlow to an Event Broker via AMQP.<BR />The AMQP adapter can be configured with Basic Authentication or with Client Certificate.<BR />This blog post shows how to configure <STRONG>client certificate</STRONG> authentication in iFlow for sending messages to <STRONG>Solace PubSub+ Event Broker</STRONG>.</P><H2 id="toc-hId-989900184">Overview</H2><P data-unlink="true"><A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-1-intro/ba-p/13644191" target="_blank">Part 1</A>: Introduction&nbsp;<BR /><A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-2/ba-p/13646997" target="_blank">Part 2</A>&nbsp;: Create Client Certificate Chain&nbsp;<BR /><A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-3-solace/ba-p/13647051" target="_blank">Part 3&nbsp;</A>: Configure Solace<BR />Part 4&nbsp;: Configure CPI&nbsp; (this blog post)<BR />&nbsp; &nbsp;4.1. Upload Certificate Chain<BR />&nbsp; &nbsp;4.2. Create iFlow<BR />&nbsp; &nbsp;4.3. Run Scenario</P><H2 id="toc-hId-793386679"><SPAN>Part 4:&nbsp;</SPAN>CPI</H2><P>Finally, all of the tutorial up to now was done to get a successful iFlow execution.<BR />In CPI, just 2 tasks are waiting for us:</P><OL><LI>Upload the security artifact (key and chain in p12 file)</LI><LI>Create iFlow</LI></OL><P>Both build upon the previous sections.</P><P><STRONG><U>4.1. Upload certificate chain to CPI Keystore</U></STRONG></P><P>We have to make our private key and the certificate (chain) available on CPI.<BR />To do so, we upload the p12 file (created in section 1.4) to the Keystore in CPI.</P><P>We logon to our tenant, then navigate to<BR />“Monitor -&gt; Integratons -&gt; Manage Security -&gt; Keystore”<BR />Press “Add -&gt; Keystore”<BR />“Browse” to <FONT face="courier new,courier">c:\solace\demostore.p12<BR /></FONT>Enter the password “abcd”<BR />Press “Deploy”.</P><P>Afterwards, we can check the uploaded artifact:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="cpi_keystore.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83745iE18FE2CBBB0D9D6D/image-size/medium?v=v2&amp;px=400" role="button" title="cpi_keystore.jpg" alt="cpi_keystore.jpg" /></span></P><P>We can see the chain with all the 3 certificates and corresponding metadata.</P><P><STRONG><U>4.2. Create iFlow</U></STRONG></P><P>We create a simple iFlow which does really nothing but sending messages to the Solace Event Broker.<BR />It does even less than that: we don’t even need a message body.<BR />Just make sure that the authentication works fine.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iflow1.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83810i212BEE5381B636D4/image-size/medium?v=v2&amp;px=400" role="button" title="iflow1.jpg" alt="iflow1.jpg" /></span></P><P><span class="lia-unicode-emoji" title=":large_orange_diamond:">🔶</span>&nbsp;The iFlow is triggered once after deploy, by a "Timer" start event.</P><P><span class="lia-unicode-emoji" title=":large_orange_diamond:">🔶</span>The adapter is of type AMQP and Transport Protocol: TCP<BR />&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span> Connection Tab<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Host: copy &amp; paste from solace connection data (see chapter 2.4. above)<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Remove the protocol and the port from the copied URI<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Port: Paste the port 5671<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Authentication: Client Certificate<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Private Key Alias: "democlient" (copied from the CPI Keystore)<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This is the name which we gave in the openssl pkc12 command.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iFlow_amqp1.jpg" style="width: 200px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83812i8C8C99C1306F99F4/image-size/small?v=v2&amp;px=200" role="button" title="iFlow_amqp1.jpg" alt="iFlow_amqp1.jpg" /></span></P><P>&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Processing Tab<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Here we have to configure that target as “Queue”<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enter the name, which in our example was the nice name “demo”:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iFlow_amqp2.jpg" style="width: 200px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83811iF36E489F2E792250/image-size/small?v=v2&amp;px=200" role="button" title="iFlow_amqp2.jpg" alt="iFlow_amqp2.jpg" /></span></P><P>That’s it already about iFlow configuration.<BR /><FONT size="2"><SPAN>(See&nbsp;</SPAN><A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-advanced-event-mesh-adapter-client-certificate-solace/ba-p/13651318" target="_blank">here</A><SPAN>&nbsp;for "Advanced Event Mesh" adapter)</SPAN></FONT></P><P><U>Summary</U><BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>We need the URL from Solace "Connection" tab.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>We need the alias name from CPI Keystore.</P><P><STRONG><U>4.3. Run Scneario</U></STRONG></P><P>Now we can deploy the iFlow and check the result:<BR />1. In CPI : The log at “Monitor Message Processing” should show success message:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="result_cpi.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83814iB4546FFDF6C7228B/image-size/medium?v=v2&amp;px=400" role="button" title="result_cpi.jpg" alt="result_cpi.jpg" /></span>2. In event broker: The number of “Messages Queued” should have increased:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="result_solace.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83813i036EBA41DF3253DC/image-size/medium?v=v2&amp;px=400" role="button" title="result_solace.jpg" alt="result_solace.jpg" /></span></P><P>With that we can be happy.<BR /><span class="lia-unicode-emoji" title=":slightly_smiling_face:">🙂</span><BR />We just wanted to see how certificate-based authentication can be realized with CPI and Solace via AMQP adapter.</P><H2 id="toc-hId-596873174">Troubleshooting</H2><P>If you get below error, don't be surprised, the text is misleading.<BR />The reason probably: The CA certificate is missing in Solace.<BR />Or the intermediate certificate is not being sent to solace.</P><P><FONT face="courier new,courier">org.apache.qpid.jms.exceptions.JMSSecuritySaslException: </FONT><BR /><FONT face="courier new,courier">Client failed to authenticate using SASL: EXTERNAL</FONT></P><H2 id="toc-hId-400359669">Summary</H2><P>In this tutorial we’ve learned how to configure client certificate authentication for connecting CPI to Solace Event Broker.<BR />We’re tried to cover nearly all involved steps.<BR />Including:<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Understanding some basic knowledge about certificates.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Creating and validating a certificate chain with OpenSSL.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Configuring CBA in Solace.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Configuring CBA in CPI<BR /><SPAN>(See&nbsp;</SPAN><A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-advanced-event-mesh-adapter-client-certificate-solace/ba-p/13651318" target="_blank">here</A><SPAN>&nbsp;for "Advanced Event Mesh" adapter)</SPAN></P><H2 id="toc-hId-203846164">Quick Guide</H2><P><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Certificate Chain:<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>The intermediate certificate must have <FONT face="courier new,courier">CA:TRUE</FONT><BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>The verify command is executed against the chain.<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>The chain must be packed into the container (p12 or jks).<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>The chain order: <EM>Root Rear.</EM><BR /><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>OpenSSL:<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Use <FONT face="courier new,courier">-extfile</FONT> option.<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Build intermediate chain.<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Apply <FONT face="courier new,courier">verify</FONT> command.<BR /><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Solace:<BR /><SPAN>&nbsp; &nbsp;&nbsp;</SPAN><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span><SPAN>Upload the root cert.<BR /></SPAN>&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Create username equal to “CN”.<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Username must be set to "Enabled".<BR /><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>CPI:<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Upload the chain, not only client cert.<BR />&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Reason:&nbsp; the chain must be sent to Solace, as at Solace only the root is known.</P><P style=" text-align: center; "><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉<span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span></img></P> 2024-03-25T12:29:22.712000+01:00 https://community.sap.com/t5/technology-blogs-by-members/beginner-s-guide-to-integration-advisor/ba-p/13629944 Beginner's Guide to Integration Advisor 2024-03-25T16:24:00.201000+01:00 PriyankaChak https://community.sap.com/t5/user/viewprofilepage/user-id/3763 <H1 id="toc-hId-859038591">Introduction:</H1><P>In this blog post, I will show a simple scenario using B2B integration advisor.&nbsp;</P><H1 id="toc-hId-662525086">Pre-requisite:</H1><P>Check this blog post for initial context:&nbsp;<A href="https://community.sap.com/t5/technology-blogs-by-members/beginner-s-guide-to-edi-integration/ba-p/13578853" target="_blank">Beginner's Guide to EDI Integration</A></P><P>To have understanding of overall features, check out this blog post: <A href="https://community.sap.com/t5/technology-blogs-by-sap/integration-advisor-overview-of-components-for-building-b2b-integration/ba-p/13512772" target="_blank">Overview of components in Integration Advisor</A></P><H1 id="toc-hId-466011581">Scenario:</H1><P>In this demo scenario, incoming EDI 850 is converted to custom sales order message.</P><P>The below is the sample input EDI 850. Please note, the below EDI does not represent/contain production data. It is fake data.</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>ISA*00* *00* *ZZ*AB01000000001 *ZZ*CD01000000002 *030415*1314*U*00401*000601830*1*T*&gt;~ GS*PO*AB01000000001*CD01000000002*20030415*1314*000341219*X*004010~ ST*850*0001~ BEG*00*DS*HW20240312**20220921*0332014937~ CUR*BY*USD~ REF*CO*0232014937~ REF*EU*2244460-DKM-0922~ PER*BD*HWPROCUREMENT3*TE*630-295-7512~ PER*IC*STEVE SMITH*TE*789-213-4444*EM*steve.smith@cao.com~ FOB*DE~ DTM*002*20220920~ TD5**2*FDE4**FedEx Ground*******CG~ N1*BT*INSIGHT DIRECT USA, INC.~ PER*AP*ORDER FLOW TEAM*TE*480-333-3000*EM*LICENSING@INSIGHT.COM~ N1*ST*Park Place Corporate Office*92*0021793569~ N2*Tayrum Steve MITCHELL~ N3*3533330 PHELPS DR~ N4*IRVING*TX*750386507*US~ PER*IC*Dayrum Keith MITCHELL*TE*2149959713~ PO1*00010*6*EA*228.41*CP*BP*DDDDELL-P22D22H*VP*9FDDDDDZ828~ CTT*1~ SE*20*0001~ ST*850*0002~ BEG*00*DS*LC20240312**20220922*0332024801~ CUR*BY*USD~ REF*CO*0332424801~ REF*EU*450176628677~ PER*BD*Licensing 7*TE*567-222-5698*FX*480-760-6126~ FOB*DE~ CSH*BK~ DTM*002*20220921~ TD5**2*UPSS**UPS Ground*******CG~ N1*BT*INSIGHT DIRECT USA, INC.~ PER*AP*ORDER FLOW TEAM*TE*480-333-3000*EM*LICENSING@INSIGHT.COM~ N1*ST*Sam Andersen*92*0010395441~ N3*3457 DASON AVE~ N4*DOCATELLO*ID*832042037*US~ PER*IC*STEVE SMITH*TE*847-402-5000~ PO1*00010*1*EA*433.67*CP*BP*ESD-DDD809A-G00-15.0*VP*6DDDTP459~ PO1*00020*1*EA*433.67*CP*BP*ESD-DDD809A-F00-15.0*VP*6EDDTP459~ PER*FF*JILL CARTER*TE*687-402-4247*EM*JCARTER@ALLSTATE.COM~ DTM*092*20220921~ DTM*093*20230921~ CTT*2~ SE*23*0002~ GE*2*000341219~ IEA*1*000601830~</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Each ST segment will create one target SalesOrder structure.</P><P>As in the sample data, it has 2 ST-SE segment pair, it will generate 2 message for target.</P><P>Expected output for 1st ST segment:</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;POEnvelope&gt; &lt;EDIHeader&gt; &lt;SenderID&gt;AB01000000001 &lt;/SenderID&gt; &lt;ISAControlNum&gt;000601830&lt;/ISAControlNum&gt; &lt;GrpControlNum&gt;000341219&lt;/GrpControlNum&gt; &lt;TxnCntrlNum&gt;0001&lt;/TxnCntrlNum&gt; &lt;/EDIHeader&gt; &lt;PO&gt; &lt;Header&gt; &lt;PONum&gt;HW20240312&lt;/PONum&gt; &lt;PODate&gt;2022-09-21&lt;/PODate&gt; &lt;POType&gt;Original&lt;/POType&gt; &lt;CustomerOrderNum/&gt; &lt;EndUserOrderNum/&gt; &lt;RequestedDate&gt;2022-09-20&lt;/RequestedDate&gt; &lt;ShipTo&gt; &lt;Name&gt;Park Place Corporate Office&lt;/Name&gt; &lt;Address&gt;IRVING,TX,750386507,US&lt;/Address&gt; &lt;/ShipTo&gt; &lt;BillTo&gt; &lt;Name&gt;INSIGHT DIRECT USA, INC.&lt;/Name&gt; &lt;/BillTo&gt; &lt;BuyerInfo&gt; &lt;Department&gt;HWPROCUREMENT3&lt;/Department&gt; &lt;Telephone&gt;630-295-7512&lt;/Telephone&gt; &lt;/BuyerInfo&gt; &lt;ContactInfo&gt; &lt;Department&gt;STEVE SMITH&lt;/Department&gt; &lt;Telephone&gt;789-213-4444&lt;/Telephone&gt; &lt;Email&gt;steve.smith@cao.com&lt;/Email&gt; &lt;/ContactInfo&gt; &lt;/Header&gt; &lt;Items&gt; &lt;Item pos="1"&gt; &lt;ItemNum&gt;00010&lt;/ItemNum&gt; &lt;Quantity&gt;6&lt;/Quantity&gt; &lt;UoM&gt;EA&lt;/UoM&gt; &lt;BuyerPartNo&gt;DDDDELL-P22D22H&lt;/BuyerPartNo&gt; &lt;SellerPartNo&gt;9FDDDDDZ828&lt;/SellerPartNo&gt; &lt;/Item&gt; &lt;/Items&gt; &lt;/PO&gt; &lt;/POEnvelope&gt;</code></pre><P>&nbsp;</P><P>For 2nd ST segment,</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;POEnvelope&gt; &lt;EDIHeader&gt; &lt;SenderID&gt;AB01000000001 &lt;/SenderID&gt; &lt;ISAControlNum&gt;000601830&lt;/ISAControlNum&gt; &lt;GrpControlNum&gt;000341219&lt;/GrpControlNum&gt; &lt;TxnCntrlNum&gt;0002&lt;/TxnCntrlNum&gt; &lt;/EDIHeader&gt; &lt;PO&gt; &lt;Header&gt; &lt;PONum&gt;LC20240312&lt;/PONum&gt; &lt;PODate&gt;2022-09-22&lt;/PODate&gt; &lt;POType&gt;Original&lt;/POType&gt; &lt;CustomerOrderNum/&gt; &lt;EndUserOrderNum/&gt; &lt;RequestedDate&gt;2022-09-21&lt;/RequestedDate&gt; &lt;ShipTo&gt; &lt;Name&gt;Sam Andersen&lt;/Name&gt; &lt;Address&gt;DOCATELLO,ID,832042037,US&lt;/Address&gt; &lt;/ShipTo&gt; &lt;BillTo&gt; &lt;Name&gt;INSIGHT DIRECT USA, INC.&lt;/Name&gt; &lt;/BillTo&gt; &lt;BuyerInfo&gt; &lt;Department&gt;Licensing 7&lt;/Department&gt; &lt;Telephone&gt;567-222-5698&lt;/Telephone&gt; &lt;Fax&gt;480-760-6126&lt;/Fax&gt; &lt;/BuyerInfo&gt; &lt;/Header&gt; &lt;Items&gt; &lt;Item pos="1"&gt; &lt;ItemNum&gt;00010&lt;/ItemNum&gt; &lt;Quantity&gt;1&lt;/Quantity&gt; &lt;UoM&gt;EA&lt;/UoM&gt; &lt;BuyerPartNo&gt;ESD-DDD809A-G00-15.0&lt;/BuyerPartNo&gt; &lt;SellerPartNo&gt;6DDDTP459&lt;/SellerPartNo&gt; &lt;/Item&gt; &lt;Item pos="2"&gt; &lt;ItemNum&gt;00020&lt;/ItemNum&gt; &lt;Quantity&gt;1&lt;/Quantity&gt; &lt;UoM&gt;EA&lt;/UoM&gt; &lt;BuyerPartNo&gt;ESD-DDD809A-F00-15.0&lt;/BuyerPartNo&gt; &lt;SellerPartNo&gt;6EDDTP459&lt;/SellerPartNo&gt; &lt;/Item&gt; &lt;/Items&gt; &lt;/PO&gt; &lt;/POEnvelope&gt;</code></pre><P>&nbsp;</P><H1 id="toc-hId-269498076">Integration Advisor</H1><H2 id="toc-hId-202067290">Step 1:</H2><P>Create MIG (Message Implementation Guideline) for source message. Use 'Get Proposal' option to get proposals.&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-07 at 5.23.41 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/77129i324E1409E62810F6/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-07 at 5.23.41 PM.png" alt="Screenshot 2024-03-07 at 5.23.41 PM.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-20 at 9.19.12 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83963i878732FF91487000/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-20 at 9.19.12 PM.png" alt="Screenshot 2024-03-20 at 9.19.12 PM.png" /></span></P><P>Based on the requirement, the nodes are qualified, for example, N1 segment - one is for Bill-To Party, another one is for Ship-To Party.</P><P>Target system can only accept PO number as max length of 20 chars. Also, PO number will either start with HW or LC. The below checks are applied.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-20 at 9.24.39 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83966iDB7FE1F5AA12B970/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-20 at 9.24.39 PM.png" alt="Screenshot 2024-03-20 at 9.24.39 PM.png" /></span></P><P>Another example is it allows to set status. If we want some fields to be further validated by reviewer, mark those status as 'For review'.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-20 at 9.29.09 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83970i244BB5F97E586520/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-20 at 9.29.09 PM.png" alt="Screenshot 2024-03-20 at 9.29.09 PM.png" /></span></P><P>Here, only the below currency codes are selected from standard ISO code list.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-20 at 9.32.26 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/83975i0F455C9406AB3AC0/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-20 at 9.32.26 PM.png" alt="Screenshot 2024-03-20 at 9.32.26 PM.png" /></span></P><H2 id="toc-hId-5553785">Step 2:</H2><P><SPAN>Create Custom Message&nbsp; for target custom PO message structure.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-06 at 9.17.26 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76629i3C1A7636E0B8AA9C/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-06 at 9.17.26 PM.png" alt="Screenshot 2024-03-06 at 9.17.26 PM.png" /></span></SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 8.45.54 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84589iEF02DB67107218B2/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 8.45.54 PM.png" alt="Screenshot 2024-03-21 at 8.45.54 PM.png" /></span></P><P>Then create MIG based for the create custom message.</P><P>In target side, we want PO Date to be in format 'YYYY-MM-DD'.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 9.15.04 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84599i20D745F2D16F178A/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 9.15.04 PM.png" alt="Screenshot 2024-03-21 at 9.15.04 PM.png" /></span></P><H2 id="toc-hId--190959720">Step 3:</H2><P>Create a MIG Code list.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 9.19.14 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84602iE3C8782EA4AE025C/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 9.19.14 PM.png" alt="Screenshot 2024-03-21 at 9.19.14 PM.png" /></span></P><P>And assign this codelist to 'POType' in Target MIG.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 9.21.00 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84603i66FE7A526DCEC63B/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 9.21.00 PM.png" alt="Screenshot 2024-03-21 at 9.21.00 PM.png" /></span></P><H2 id="toc-hId--387473225">Step 4:</H2><P>Create MAG for mapping source to target. As custom message is used at target, proposal will not give any results.</P><P>SenderID, ISAControlNum and GrpControlNum are assigned to arbitrary constant values, which later will be changed in iflow.</P><P>For POType, code value mapping is used. The criteria to use code value mapping is both source and target field (leaf nodes) should be assigned to a codelist.</P><P>I<span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 9.33.39 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84605i5ECD324DAACD622D/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 9.33.39 PM.png" alt="Screenshot 2024-03-21 at 9.33.39 PM.png" /></span></P><P>Address should be like - City Name,State or Province Code,Postal Code,Country Code</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 9.39.38 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84608i4F9A70D399A2DC96/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 9.39.38 PM.png" alt="Screenshot 2024-03-21 at 9.39.38 PM.png" /></span></P><P>To get position,</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 9.43.24 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84609i73CA6BCBF8FF5472/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 9.43.24 PM.png" alt="Screenshot 2024-03-21 at 9.43.24 PM.png" /></span></P><H2 id="toc-hId--583986730">Step 5:</H2><P>Download the cloud integration runtime artifacts or use 'Inject' functionality.&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 9.47.13 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84614iEF42D10047688A01/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 9.47.13 PM.png" alt="Screenshot 2024-03-21 at 9.47.13 PM.png" /></span></P><H2 id="toc-hId--780500235"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 11.15.49 AM.png" style="width: 958px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85540i959AFD79A84EB7BC/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 11.15.49 AM.png" alt="Screenshot 2024-03-24 at 11.15.49 AM.png" /></span></H2><H2 id="toc-hId--629759383">Step 6:</H2><P>For flow design, refer to standard template '<SPAN>EDI Integration Templates for SAP Integration Advisor'.</SPAN></P><P><SPAN>The below is the custom iflow for this scenario.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 9.53.54 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84618i6D98AF19CE272F81/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 9.53.54 PM.png" alt="Screenshot 2024-03-21 at 9.53.54 PM.png" /></span></SPAN></P><H3 id="toc-hId--1119675895"><SPAN>1. Content Modifier: </SPAN></H3><P><SPAN>Input EDI 850 message</SPAN></P><H3 id="toc-hId--1316189400"><SPAN>2. EDI Splitter:</SPAN></H3><P><SPAN>It will split the incoming message based on based on number of ST segments. Also, it can be used to auto generate acknowledgement.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 10.03.10 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84620i7A0DC8F4A9DE0019/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 10.03.10 PM.png" alt="Screenshot 2024-03-21 at 10.03.10 PM.png" /></span></SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.26.02 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85610iD5D1C64F48836EA6/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.26.02 PM.png" alt="Screenshot 2024-03-24 at 10.26.02 PM.png" /></span></SPAN></P><P>&nbsp;</P><P><SPAN>Validate Message option checks if it the EDI document is valid. For example, if SE01 contains incorrect count, it will send a negative acknowledgement and stop the processing.</SPAN></P><P><SPAN>For example, if 2nd SE02 contains incorrect count, all ST segments are rejected as Transaction mode is 'Interchange'.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 10.12.09 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84623i04AF346B1DAC42A9/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 10.12.09 PM.png" alt="Screenshot 2024-03-21 at 10.12.09 PM.png" /></span></SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 10.16.12 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84624i40AF8C456AE9456D/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 10.16.12 PM.png" alt="Screenshot 2024-03-21 at 10.16.12 PM.png" /></span></SPAN></P><P>Now, if we change Transaction mode to 'Message', 1st one will be accepted and 2nd one will be rejected.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-21 at 10.31.00 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84629iA1A6446E33D25490/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-21 at 10.31.00 PM.png" alt="Screenshot 2024-03-21 at 10.31.00 PM.png" /></span></P><P>Create Acknowledgement is based on 'Check EDI Envelop' i.e,&nbsp;<SPAN>ISA14. As ISA14 value is 1, the EDI 997 message is generated.</SPAN></P><P><SPAN>For Interchange number in EDI 997, Number Range is used.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 8.55.20 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85560iD10025D59146F973/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 8.55.20 PM.png" alt="Screenshot 2024-03-24 at 8.55.20 PM.png" /></span></SPAN></P><P><SPAN>The next value will be using for the incoming unique message (determined based on ISA13). If the message is duplicate, the same value will be used in EDI 997.</SPAN></P><P><SPAN>The output of EDI Splitter as per current configuration, 2 EDI 850 message and 1 EDI 997 message.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 9.04.41 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85565i9EF4FB2E258203B7/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 9.04.41 PM.png" alt="Screenshot 2024-03-24 at 9.04.41 PM.png" /></span></SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 9.05.42 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85566i9F5B06B0F9B5A4E7/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 9.05.42 PM.png" alt="Screenshot 2024-03-24 at 9.05.42 PM.png" /></span></SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 9.07.42 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85567iB0EF2F1D9D7D835F/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 9.07.42 PM.png" alt="Screenshot 2024-03-24 at 9.07.42 PM.png" /></span></P><P>For EDI 997, standard header '<SPAN>EDI_ACKNOWLEDGEMENT' value is true.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 9.09.05 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85568i31E177FA8186BF8F/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 9.09.05 PM.png" alt="Screenshot 2024-03-24 at 9.09.05 PM.png" /></span></P><P>The below headers are generated due to EDI Splitter step.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 9.16.08 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85569i97AEB34D1CA2224D/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 9.16.08 PM.png" alt="Screenshot 2024-03-24 at 9.16.08 PM.png" /></span></P><H3 id="toc-hId--1512702905">3. Router:</H3><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 9.39.27 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85571i3BDCC50C4364AB57/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 9.39.27 PM.png" alt="Screenshot 2024-03-24 at 9.39.27 PM.png" /></span></P><H3 id="toc-hId--1709216410">4. EDI to XML Converter:</H3><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 9.44.09 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85574iD30E7B1E692D0966/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 9.44.09 PM.png" alt="Screenshot 2024-03-24 at 9.44.09 PM.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.26.02 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85611iBD0B6CE845A4EB62/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.26.02 PM.png" alt="Screenshot 2024-03-24 at 10.26.02 PM.png" /></span></P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;&lt;ns0:Interchange xmlns:ns0="urn:sap.com:typesystem:b2b:116:asc-x12:004010"&gt; &lt;S_ISA&gt; &lt;D_I01&gt;00&lt;/D_I01&gt; &lt;D_I02&gt; &lt;/D_I02&gt; &lt;D_I03&gt;00&lt;/D_I03&gt; &lt;D_I04&gt; &lt;/D_I04&gt; &lt;D_I05_1&gt;ZZ&lt;/D_I05_1&gt; &lt;D_I06&gt;AB01000000001 &lt;/D_I06&gt; &lt;D_I05_2&gt;ZZ&lt;/D_I05_2&gt; &lt;D_I07&gt;CD01000000002 &lt;/D_I07&gt; &lt;D_I08&gt;030415&lt;/D_I08&gt; &lt;D_I09&gt;1314&lt;/D_I09&gt; &lt;D_I10&gt;U&lt;/D_I10&gt; &lt;D_I11&gt;00401&lt;/D_I11&gt; &lt;D_I12&gt;000601831&lt;/D_I12&gt; &lt;D_I13&gt;1&lt;/D_I13&gt; &lt;D_I14&gt;T&lt;/D_I14&gt; &lt;D_I15&gt;&amp;gt;&lt;/D_I15&gt; &lt;/S_ISA&gt; &lt;FunctionalGroup&gt; &lt;S_GS&gt; &lt;D_479&gt;PO&lt;/D_479&gt; &lt;D_142&gt;AB01000000001&lt;/D_142&gt; &lt;D_124&gt;CD01000000002&lt;/D_124&gt; &lt;D_373&gt;20030415&lt;/D_373&gt; &lt;D_337&gt;1314&lt;/D_337&gt; &lt;D_28&gt;000341219&lt;/D_28&gt; &lt;D_455&gt;X&lt;/D_455&gt; &lt;D_480&gt;004010&lt;/D_480&gt; &lt;/S_GS&gt; &lt;M_850&gt; &lt;S_ST&gt; &lt;D_143&gt;850&lt;/D_143&gt; &lt;D_329&gt;0001&lt;/D_329&gt; &lt;/S_ST&gt; &lt;S_BEG&gt; &lt;D_353&gt;00&lt;/D_353&gt; &lt;D_92&gt;DS&lt;/D_92&gt; &lt;D_324&gt;HW20240312&lt;/D_324&gt; &lt;D_373&gt;20220921&lt;/D_373&gt; &lt;D_367&gt;0332014937&lt;/D_367&gt; &lt;/S_BEG&gt; &lt;S_CUR&gt; &lt;D_98&gt;BY&lt;/D_98&gt; &lt;D_100&gt;USD&lt;/D_100&gt; &lt;/S_CUR&gt; &lt;S_REF&gt; &lt;D_128&gt;CO&lt;/D_128&gt; &lt;D_127&gt;0232014937&lt;/D_127&gt; &lt;/S_REF&gt; &lt;S_REF&gt; &lt;D_128&gt;EU&lt;/D_128&gt; &lt;D_127&gt;2244460-DKM-0922&lt;/D_127&gt; &lt;/S_REF&gt; &lt;S_PER&gt; &lt;D_366&gt;BD&lt;/D_366&gt; &lt;D_93&gt;HWPROCUREMENT3&lt;/D_93&gt; &lt;D_365&gt;TE&lt;/D_365&gt; &lt;D_364&gt;630-295-7512&lt;/D_364&gt; &lt;/S_PER&gt; &lt;S_PER&gt; &lt;D_366&gt;IC&lt;/D_366&gt; &lt;D_93&gt;STEVE SMITH&lt;/D_93&gt; &lt;D_365&gt;TE&lt;/D_365&gt; &lt;D_364&gt;789-213-4444&lt;/D_364&gt; &lt;D_365_2&gt;EM&lt;/D_365_2&gt; &lt;D_364_2&gt;steve.smith@cao.com&lt;/D_364_2&gt; &lt;/S_PER&gt; &lt;S_FOB&gt; &lt;D_146&gt;DE&lt;/D_146&gt; &lt;/S_FOB&gt; &lt;S_DTM&gt; &lt;D_374&gt;002&lt;/D_374&gt; &lt;D_373&gt;20220920&lt;/D_373&gt; &lt;/S_DTM&gt; &lt;S_TD5&gt; &lt;D_66&gt;2&lt;/D_66&gt; &lt;D_67&gt;FDE4&lt;/D_67&gt; &lt;D_387&gt;FedEx Ground&lt;/D_387&gt; &lt;D_284&gt;CG&lt;/D_284&gt; &lt;/S_TD5&gt; &lt;G_N1&gt; &lt;S_N1&gt; &lt;D_98&gt;BT&lt;/D_98&gt; &lt;D_93&gt;INSIGHT DIRECT USA, INC.&lt;/D_93&gt; &lt;/S_N1&gt; &lt;S_PER&gt; &lt;D_366&gt;AP&lt;/D_366&gt; &lt;D_93&gt;ORDER FLOW TEAM&lt;/D_93&gt; &lt;D_365&gt;TE&lt;/D_365&gt; &lt;D_364&gt;480-333-3000&lt;/D_364&gt; &lt;D_365_2&gt;EM&lt;/D_365_2&gt; &lt;D_364_2&gt;LICENSING@INSIGHT.COM&lt;/D_364_2&gt; &lt;/S_PER&gt; &lt;/G_N1&gt; &lt;G_N1&gt; &lt;S_N1&gt; &lt;D_98&gt;ST&lt;/D_98&gt; &lt;D_93&gt;Park Place Corporate Office&lt;/D_93&gt; &lt;D_66&gt;92&lt;/D_66&gt; &lt;D_67&gt;0021793569&lt;/D_67&gt; &lt;/S_N1&gt; &lt;S_N2&gt; &lt;D_93&gt;Tayrum Steve MITCHELL&lt;/D_93&gt; &lt;/S_N2&gt; &lt;S_N3&gt; &lt;D_166&gt;3533330 PHELPS DR&lt;/D_166&gt; &lt;/S_N3&gt; &lt;S_N4&gt; &lt;D_19&gt;IRVING&lt;/D_19&gt; &lt;D_156&gt;TX&lt;/D_156&gt; &lt;D_116&gt;750386507&lt;/D_116&gt; &lt;D_26&gt;US&lt;/D_26&gt; &lt;/S_N4&gt; &lt;S_PER&gt; &lt;D_366&gt;IC&lt;/D_366&gt; &lt;D_93&gt;Dayrum Keith MITCHELL&lt;/D_93&gt; &lt;D_365&gt;TE&lt;/D_365&gt; &lt;D_364&gt;2149959713&lt;/D_364&gt; &lt;/S_PER&gt; &lt;/G_N1&gt; &lt;G_PO1&gt; &lt;S_PO1&gt; &lt;D_350&gt;00010&lt;/D_350&gt; &lt;D_330&gt;6&lt;/D_330&gt; &lt;D_355&gt;EA&lt;/D_355&gt; &lt;D_212&gt;228.41&lt;/D_212&gt; &lt;D_639&gt;CP&lt;/D_639&gt; &lt;D_235&gt;BP&lt;/D_235&gt; &lt;D_234&gt;DDDDELL-P22D22H&lt;/D_234&gt; &lt;D_235_2&gt;VP&lt;/D_235_2&gt; &lt;D_234_2&gt;9FDDDDDZ828&lt;/D_234_2&gt; &lt;/S_PO1&gt; &lt;/G_PO1&gt; &lt;G_CTT&gt; &lt;S_CTT&gt; &lt;D_354&gt;1&lt;/D_354&gt; &lt;/S_CTT&gt; &lt;/G_CTT&gt; &lt;S_SE&gt; &lt;D_96&gt;20&lt;/D_96&gt; &lt;D_329&gt;0001&lt;/D_329&gt; &lt;/S_SE&gt; &lt;/M_850&gt; &lt;S_GE&gt; &lt;D_97&gt;1&lt;/D_97&gt; &lt;D_28&gt;000341219&lt;/D_28&gt; &lt;/S_GE&gt; &lt;/FunctionalGroup&gt; &lt;S_IEA&gt; &lt;D_I16&gt;1&lt;/D_I16&gt; &lt;D_I12&gt;000601831&lt;/D_I12&gt; &lt;/S_IEA&gt; &lt;/ns0:Interchange&gt;</code></pre><pre class="lia-code-sample language-markup"><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;&lt;ns0:Interchange xmlns:ns0="urn:sap.com:typesystem:b2b:116:asc-x12:004010"&gt; &lt;S_ISA&gt; &lt;D_I01&gt;00&lt;/D_I01&gt; &lt;D_I02&gt; &lt;/D_I02&gt; &lt;D_I03&gt;00&lt;/D_I03&gt; &lt;D_I04&gt; &lt;/D_I04&gt; &lt;D_I05_1&gt;ZZ&lt;/D_I05_1&gt; &lt;D_I06&gt;AB01000000001 &lt;/D_I06&gt; &lt;D_I05_2&gt;ZZ&lt;/D_I05_2&gt; &lt;D_I07&gt;CD01000000002 &lt;/D_I07&gt; &lt;D_I08&gt;030415&lt;/D_I08&gt; &lt;D_I09&gt;1314&lt;/D_I09&gt; &lt;D_I10&gt;U&lt;/D_I10&gt; &lt;D_I11&gt;00401&lt;/D_I11&gt; &lt;D_I12&gt;000601831&lt;/D_I12&gt; &lt;D_I13&gt;1&lt;/D_I13&gt; &lt;D_I14&gt;T&lt;/D_I14&gt; &lt;D_I15&gt;&amp;gt;&lt;/D_I15&gt; &lt;/S_ISA&gt; &lt;FunctionalGroup&gt; &lt;S_GS&gt; &lt;D_479&gt;PO&lt;/D_479&gt; &lt;D_142&gt;AB01000000001&lt;/D_142&gt; &lt;D_124&gt;CD01000000002&lt;/D_124&gt; &lt;D_373&gt;20030415&lt;/D_373&gt; &lt;D_337&gt;1314&lt;/D_337&gt; &lt;D_28&gt;000341219&lt;/D_28&gt; &lt;D_455&gt;X&lt;/D_455&gt; &lt;D_480&gt;004010&lt;/D_480&gt; &lt;/S_GS&gt; &lt;M_850&gt; &lt;S_ST&gt; &lt;D_143&gt;850&lt;/D_143&gt; &lt;D_329&gt;0002&lt;/D_329&gt; &lt;/S_ST&gt; &lt;S_BEG&gt; &lt;D_353&gt;00&lt;/D_353&gt; &lt;D_92&gt;DS&lt;/D_92&gt; &lt;D_324&gt;LC20240312&lt;/D_324&gt; &lt;D_373&gt;20220922&lt;/D_373&gt; &lt;D_367&gt;0332024801&lt;/D_367&gt; &lt;/S_BEG&gt; &lt;S_CUR&gt; &lt;D_98&gt;BY&lt;/D_98&gt; &lt;D_100&gt;USD&lt;/D_100&gt; &lt;/S_CUR&gt; &lt;S_REF&gt; &lt;D_128&gt;CO&lt;/D_128&gt; &lt;D_127&gt;0332424801&lt;/D_127&gt; &lt;/S_REF&gt; &lt;S_REF&gt; &lt;D_128&gt;EU&lt;/D_128&gt; &lt;D_127&gt;450176628677&lt;/D_127&gt; &lt;/S_REF&gt; &lt;S_PER&gt; &lt;D_366&gt;BD&lt;/D_366&gt; &lt;D_93&gt;Licensing 7&lt;/D_93&gt; &lt;D_365&gt;TE&lt;/D_365&gt; &lt;D_364&gt;567-222-5698&lt;/D_364&gt; &lt;D_365_2&gt;FX&lt;/D_365_2&gt; &lt;D_364_2&gt;480-760-6126&lt;/D_364_2&gt; &lt;/S_PER&gt; &lt;S_FOB&gt; &lt;D_146&gt;DE&lt;/D_146&gt; &lt;/S_FOB&gt; &lt;S_CSH&gt; &lt;D_563&gt;BK&lt;/D_563&gt; &lt;/S_CSH&gt; &lt;S_DTM&gt; &lt;D_374&gt;002&lt;/D_374&gt; &lt;D_373&gt;20220921&lt;/D_373&gt; &lt;/S_DTM&gt; &lt;S_TD5&gt; &lt;D_66&gt;2&lt;/D_66&gt; &lt;D_67&gt;UPSS&lt;/D_67&gt; &lt;D_387&gt;UPS Ground&lt;/D_387&gt; &lt;D_284&gt;CG&lt;/D_284&gt; &lt;/S_TD5&gt; &lt;G_N1&gt; &lt;S_N1&gt; &lt;D_98&gt;BT&lt;/D_98&gt; &lt;D_93&gt;INSIGHT DIRECT USA, INC.&lt;/D_93&gt; &lt;/S_N1&gt; &lt;S_PER&gt; &lt;D_366&gt;AP&lt;/D_366&gt; &lt;D_93&gt;ORDER FLOW TEAM&lt;/D_93&gt; &lt;D_365&gt;TE&lt;/D_365&gt; &lt;D_364&gt;480-333-3000&lt;/D_364&gt; &lt;D_365_2&gt;EM&lt;/D_365_2&gt; &lt;D_364_2&gt;LICENSING@INSIGHT.COM&lt;/D_364_2&gt; &lt;/S_PER&gt; &lt;/G_N1&gt; &lt;G_N1&gt; &lt;S_N1&gt; &lt;D_98&gt;ST&lt;/D_98&gt; &lt;D_93&gt;Sam Andersen&lt;/D_93&gt; &lt;D_66&gt;92&lt;/D_66&gt; &lt;D_67&gt;0010395441&lt;/D_67&gt; &lt;/S_N1&gt; &lt;S_N3&gt; &lt;D_166&gt;3457 DASON AVE&lt;/D_166&gt; &lt;/S_N3&gt; &lt;S_N4&gt; &lt;D_19&gt;DOCATELLO&lt;/D_19&gt; &lt;D_156&gt;ID&lt;/D_156&gt; &lt;D_116&gt;832042037&lt;/D_116&gt; &lt;D_26&gt;US&lt;/D_26&gt; &lt;/S_N4&gt; &lt;S_PER&gt; &lt;D_366&gt;IC&lt;/D_366&gt; &lt;D_93&gt;STEVE SMITH&lt;/D_93&gt; &lt;D_365&gt;TE&lt;/D_365&gt; &lt;D_364&gt;847-402-5000&lt;/D_364&gt; &lt;/S_PER&gt; &lt;/G_N1&gt; &lt;G_PO1&gt; &lt;S_PO1&gt; &lt;D_350&gt;00010&lt;/D_350&gt; &lt;D_330&gt;1&lt;/D_330&gt; &lt;D_355&gt;EA&lt;/D_355&gt; &lt;D_212&gt;433.67&lt;/D_212&gt; &lt;D_639&gt;CP&lt;/D_639&gt; &lt;D_235&gt;BP&lt;/D_235&gt; &lt;D_234&gt;ESD-DDD809A-G00-15.0&lt;/D_234&gt; &lt;D_235_2&gt;VP&lt;/D_235_2&gt; &lt;D_234_2&gt;6DDDTP459&lt;/D_234_2&gt; &lt;/S_PO1&gt; &lt;/G_PO1&gt; &lt;G_PO1&gt; &lt;S_PO1&gt; &lt;D_350&gt;00020&lt;/D_350&gt; &lt;D_330&gt;1&lt;/D_330&gt; &lt;D_355&gt;EA&lt;/D_355&gt; &lt;D_212&gt;433.67&lt;/D_212&gt; &lt;D_639&gt;CP&lt;/D_639&gt; &lt;D_235&gt;BP&lt;/D_235&gt; &lt;D_234&gt;ESD-DDD809A-F00-15.0&lt;/D_234&gt; &lt;D_235_2&gt;VP&lt;/D_235_2&gt; &lt;D_234_2&gt;6EDDTP459&lt;/D_234_2&gt; &lt;/S_PO1&gt; &lt;S_PER&gt; &lt;D_366&gt;FF&lt;/D_366&gt; &lt;D_93&gt;JILL CARTER&lt;/D_93&gt; &lt;D_365&gt;TE&lt;/D_365&gt; &lt;D_364&gt;687-402-4247&lt;/D_364&gt; &lt;D_365_2&gt;EM&lt;/D_365_2&gt; &lt;D_364_2&gt;JCARTER@ALLSTATE.COM&lt;/D_364_2&gt; &lt;/S_PER&gt; &lt;S_DTM&gt; &lt;D_374&gt;092&lt;/D_374&gt; &lt;D_373&gt;20220921&lt;/D_373&gt; &lt;/S_DTM&gt; &lt;S_DTM&gt; &lt;D_374&gt;093&lt;/D_374&gt; &lt;D_373&gt;20230921&lt;/D_373&gt; &lt;/S_DTM&gt; &lt;/G_PO1&gt; &lt;G_CTT&gt; &lt;S_CTT&gt; &lt;D_354&gt;2&lt;/D_354&gt; &lt;/S_CTT&gt; &lt;/G_CTT&gt; &lt;S_SE&gt; &lt;D_96&gt;23&lt;/D_96&gt; &lt;D_329&gt;0002&lt;/D_329&gt; &lt;/S_SE&gt; &lt;/M_850&gt; &lt;S_GE&gt; &lt;D_97&gt;1&lt;/D_97&gt; &lt;D_28&gt;000341219&lt;/D_28&gt; &lt;/S_GE&gt; &lt;/FunctionalGroup&gt; &lt;S_IEA&gt; &lt;D_I16&gt;1&lt;/D_I16&gt; &lt;D_I12&gt;000601831&lt;/D_I12&gt; &lt;/S_IEA&gt; &lt;/ns0:Interchange&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><H3 id="toc-hId--1905729915">5. XSLT Mapping:</H3><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 9.56.45 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85575iBD65A4E4C2154945/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 9.56.45 PM.png" alt="Screenshot 2024-03-24 at 9.56.45 PM.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.28.11 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85612iE769E5AE4F1911EA/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.28.11 PM.png" alt="Screenshot 2024-03-24 at 10.28.11 PM.png" /></span></P><P>This step will add qualifier to the node names using preproc.xsl.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 9.59.26 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85588i8E69848010F61D67/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 9.59.26 PM.png" alt="Screenshot 2024-03-24 at 9.59.26 PM.png" /></span></P><H3 id="toc-hId--2102243420">6. XML Validator:</H3><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.09.48 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85591i5BE6A3AA4D5179CF/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.09.48 PM.png" alt="Screenshot 2024-03-24 at 10.09.48 PM.png" /></span></P><P>For example, If PO Number does not start with HW or LC, it will throw an error.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.16.39 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85598i5B30592CFA0D7A54/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.16.39 PM.png" alt="Screenshot 2024-03-24 at 10.16.39 PM.png" /></span></P><H3 id="toc-hId-1996210371">7. XSLT Mapping:</H3><P>To convert source structure to target structure.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.29.36 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85613i7AE8D29354F44AA9/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.29.36 PM.png" alt="Screenshot 2024-03-24 at 10.29.36 PM.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.30.27 PM.png" style="width: 786px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85614i7036DD9FD831274F/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.30.27 PM.png" alt="Screenshot 2024-03-24 at 10.30.27 PM.png" /></span></P><H3 id="toc-hId-1799696866">8. XSLT Mapping:</H3><P>XSLT mapping to populate control number for reference in target message.</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="#all"&gt; &lt;xsl:mode on-no-match="shallow-copy" /&gt; &lt;xsl:output method="xml" indent="yes" /&gt; &lt;xsl:param name="SAP_EDI_Interchange_Control_Number" as="xs:string" /&gt; &lt;xsl:param name="SAP_EDI_GS_Control_Number" as="xs:string" /&gt; &lt;xsl:param name="SAP_EDI_Sender_ID" as="xs:string" /&gt; &lt;xsl:param name="SAP_ST_Control_Number" as="xs:string" /&gt; &lt;xsl:template match="/POEnvelope/EDIHeader/SenderID"&gt; &lt;xsl:copy&gt; &lt;xsl:value-of select="$SAP_EDI_Sender_ID" /&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="/POEnvelope/EDIHeader/ISAControlNum"&gt; &lt;xsl:copy&gt; &lt;xsl:value-of select="$SAP_EDI_Interchange_Control_Number" /&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="/POEnvelope/EDIHeader/GrpControlNum"&gt; &lt;xsl:copy&gt; &lt;xsl:value-of select="$SAP_EDI_GS_Control_Number" /&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="EDIHeader"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()"/&gt; &lt;TxnCntrlNum&gt; &lt;xsl:value-of select="$SAP_ST_Control_Number" /&gt; &lt;/TxnCntrlNum&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt;</code></pre><P>&nbsp;</P><H1 id="toc-hId--2104977921">Reverse Flow:</H1><P>The below shows the steps for SOAP to EDI coversion.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.45.34 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85617iB1B68AD5867DCA5C/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.45.34 PM.png" alt="Screenshot 2024-03-24 at 10.45.34 PM.png" /></span></P><OL><LI>SOAP Pre-processing to add qualifier to the node name using source MIG preproc XSL</LI><LI>SOAP to X12 mapping using MAG xsl</LI><LI>XSLT mapping to get the count for <SPAN>SE01</SPAN> segment</LI><LI>XML validator using &lt;Target_MIG&gt;_RD.xsd</LI><LI>Content modifier to set ISA and GS segment values.<span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.58.33 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85618iFA20F18DA30E37EB/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.58.33 PM.png" alt="Screenshot 2024-03-24 at 10.58.33 PM.png" /></span></LI><LI>XML to EDI converter to convert EDI-XML to EDI.<span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 11.01.11 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/85621iE691AB536CF1A0AD/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 11.01.11 PM.png" alt="Screenshot 2024-03-24 at 11.01.11 PM.png" /></span></LI></OL><H1 id="toc-hId--2133307735">Reference Link:</H1><P><A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/sap-integration-advisor" target="_self" rel="noopener noreferrer">SAP Integration Advisor</A></P><P>Regards,</P><P>Priyanka Chakraborti</P> 2024-03-25T16:24:00.201000+01:00 https://community.sap.com/t5/technology-blogs-by-sap/sap-integration-suite-access-policies-for-integration-packages/ba-p/13648901 SAP Integration Suite – Access Policies for Integration Packages 2024-03-25T18:55:44.335000+01:00 PeterGutsche https://community.sap.com/t5/user/viewprofilepage/user-id/198344 <P>As of increment 2401 of SAP Integration Suite, you can define access policies for integration packages.&nbsp;This extension makes the lives of tenant administrators easier who need to manage large numbers of integration packages and selectively restrict access to integration content for &nbsp;different user groups.</P><TABLE border="1" width="100%"><TBODY><TR><TD width="100%"><P><STRONG>Short reminder of what Access Policies are:</STRONG></P><P>With an access policy, you can protect groups of integration artifacts against undesired access. You define access policies as described in SAP Help Portal under <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/managing-access-policies" target="_blank" rel="noopener noreferrer">Managing Access Policies | SAP Help Portal</A>.</P><P>For example, you can define an access policy for all integration flows that fulfil the condition: name contains the string ‘Read’. As consequence, all integration flows that meet this condition are protected against unauthorized access.</P><P>Protection against unauthorized access covers:</P><UL><LI>All operations on the design time artifacts (such like editing, saving, or deploying an artifact, for example)</LI><LI>All operations on the deployed runtime artifacts (like restarting an artifact, for example)</LI><LI>Data that is processed or stored by the artifacts (like business data stored for monitoring purposes or stored by integration flows in local data stores or variables)</LI></UL><P>To enable dedicated users to access these protected artifacts, a role needs to be defined in SAP Business Technology Platform (SAP BTP) cockpit that is associated with the access policy (for more information, see the online documentation).</P><P>Access policies can be defined for all available integration artifact types such like integration flows, value mappings, and so forth.</P></TD></TR></TBODY></TABLE><P>Back to the new feature introduced with increment 2401.</P><P>When you open the access policy screen in the <STRONG>Monitor</STRONG> &gt; <STRONG>Integrations and APIs</STRONG> section of SAP Integration Suite (<STRONG>Access Policies</STRONG> tile), you now notice that you can also select <STRONG>Integration Package</STRONG> as <STRONG>Type</STRONG>:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AccessPoliciesIntegrationPackage.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/86122iC508CD1D52E4525E/image-size/large?v=v2&amp;px=999" role="button" title="AccessPoliciesIntegrationPackage.png" alt="AccessPoliciesIntegrationPackage.png" /></span></P><P>Using this new option, you only need to specify <STRONG>one single</STRONG> artifact reference to protect <STRONG>all</STRONG> artifacts of an integration package. In the example above, an artifact reference for the integration package with the name <STRONG>My First Integration Package</STRONG> is defined.</P><P>You now also understand to what extent the extension makes the life of the tenant administrator easier, whom we talked about earlier:</P><P>If you like to protect all artifacts in a dedicated integration package, you can now define an access policy with <EM>one</EM> <EM>single</EM> artifact reference. Before this enhancement, you needed to create an individual artifact references for each integration artifact type separately.</P><H2 id="toc-hId-989938434">Use Cases</H2><P>You may be wondering in which cases it makes sense to define access policies for integration packages. Let me point out the following rule of thumb:</P><TABLE border="1" width="100%"><TBODY><TR><TD width="50%"><STRONG>Option</STRONG></TD><TD width="50%"><STRONG>Use Case</STRONG></TD></TR><TR><TD width="50%">Define access policy for an integration package …</TD><TD width="50%">If you like to protect all the artifacts of an integration package (including artifacts of all types).</TD></TR><TR><TD width="50%">Define access policy for individual artifact types (for example, integration flows and value mappings) …</TD><TD width="50%">If you like to protect only few, but not all artifacts of the integration package.</TD></TR></TBODY></TABLE><H2 id="toc-hId-793424929">Compatibility with Access Policies for Specific Artifact Types</H2><P>As said, an access policy for an integration package affects the access to <EM>all artifact types</EM> contained in the package. However, you can still define access policies for individual artifact types. Now the following can happen: you may want to define an access policy for a specific integration package that contains artifacts for which other, artifact type-specific access policies exist already. What happens in such a case? The message at the top of the dialog provides a clue: for compatibility reasons, existing access policies for individual artifact types will remain intact when you define an access policy for an integration package. Access policies for dedicated artifact types co-exist with access policies on integration package level. Or, phrased differently: When you define an access policy for an integration package that contains artifacts that are also protected by another access policy (for example, by an access policy for a specific group of integration flows), the latter remain valid as well. The message prompts you to check if access policies have already been defined for specific artifacts in your package that you want to protect as a whole.</P><P>Let's see how the co-existence of access policies on integration package and on artifact level affects things in a specific example.</P><P>Let’s assume that an integration package is protected by one access policy. Furthermore, this integration package contains an integration flow that is protected by another access policy.</P><P>To walk you through the example step-by-step, the following two access policies are defined:</P><TABLE border="1" width="100%"><TBODY><TR><TD width="50%"><STRONG>Access Policy Name</STRONG></TD><TD width="50%"><STRONG>Protects</STRONG></TD></TR><TR><TD width="50%">PackageAccess</TD><TD width="50%">Artifacts contained in the integration package with the name <STRONG>My First Integration Package</STRONG></TD></TR><TR><TD width="50%">FlowAccess</TD><TD width="50%">Integration flows (across all integration packages) with a name that starts with the word <STRONG>Read </STRONG>(matches regular expression <STRONG>^Read.*</STRONG>)</TD></TR></TBODY></TABLE><P>The tenant has two integration packages with the names <STRONG>My First Integration Package</STRONG> and <STRONG>My Second Integration Package</STRONG>. Both packages contain also integration flows protected by the artifact-related access policy (integration flows with a naming starting with <STRONG>Read</STRONG>).</P><P>As a result of this setup, the artifacts are now protected as shown in the following figure:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BLOG_AccessPolicie.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/86123i4739266C6403B086/image-size/large?v=v2&amp;px=999" role="button" title="BLOG_AccessPolicie.png" alt="BLOG_AccessPolicie.png" /></span></P><P>As we said that access policies protect the specified artifacts – unless a user has a role assigned that is associated with the access policy – we can do the combinatorics with 4 fictitious users with different role assignments:</P><TABLE border="1" width="100%"><TBODY><TR><TD width="25%"><STRONG>User</STRONG></TD><TD width="25%"><STRONG>Assigned role</STRONG></TD><TD width="25%"><STRONG>Role associated with access policy*</STRONG></TD><TD width="25%"><STRONG>Can access</STRONG></TD></TR><TR><TD width="25%">User1</TD><TD width="25%"><P>Role1</P>Role2</TD><TD width="25%"><P>PackageAccess</P>FlowAccess</TD><TD width="25%">All artifacts in all shown integration packages</TD></TR><TR><TD width="25%">User2</TD><TD width="25%">Role1</TD><TD width="25%">PackageAccess</TD><TD width="25%"><UL><LI>In the package <STRONG>My First Integration Package </STRONG>protected by the package-level access policy: All artifacts</LI><LI>In the non-protected package&nbsp;<STRONG>My Second Integration Package</STRONG><SPAN>: all artifacts, unless they are protected by access policy </SPAN><STRONG>FlowAccess</STRONG><SPAN> (for which this user has </SPAN><STRONG>no</STRONG><SPAN> corresponding role assignment)</SPAN></LI></UL></TD></TR><TR><TD width="25%">User3</TD><TD width="25%">Role2</TD><TD width="25%">FlowAccess</TD><TD width="25%"><UL><LI>In the package <STRONG>My First Integration Package </STRONG>protected by the package-level access policy: integration flows that are protected by the access policy <STRONG>FlowAccess</STRONG>. All other artifacts are protected from this user through the package-level access policy <STRONG>PackageAccess</STRONG><SPAN>.</SPAN></LI></UL><UL><LI>In the non-protected package <STRONG>My Second Integration Package</STRONG><SPAN>: All artifacts (because here, this user also can access the artifacts protected by the integration flow-related access policy </SPAN><STRONG>FlowAccess</STRONG><SPAN>)</SPAN></LI></UL></TD></TR><TR><TD width="25%">User4</TD><TD width="25%">(No role assigned)</TD><TD width="25%">n.a.</TD><TD width="25%"><P>Because this user does not have either of the roles, they are subject to the access restrictions defined by both access policies.</P>As a result, the only artifact they can access is the artifact that is covered by none of the access policies (the non-protected integration flow in the non-protected integration package).</TD></TR></TBODY></TABLE><P>*To be more precise: Role associated with an access policy means: For the <STRONG>Values</STRONG> attribute of the role a string is specified that matches the name of the access policy. For more information on this, check out the online documentation in SAP Help Portal under <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/security-managing-access-policies" target="_self" rel="noopener noreferrer">Creating Custom Roles for Access Policies | SAP Help Portal</A>.</P> 2024-03-25T18:55:44.335000+01:00 https://community.sap.com/t5/enterprise-architecture-blog-posts/unleash-the-power-of-real-time-business-insights-with-sap-advanced-event/ba-p/13646287 Unleash the Power of Real-Time Business Insights with SAP Advanced Event Mesh 2024-03-26T03:57:44.968000+01:00 Nallam_97 https://community.sap.com/t5/user/viewprofilepage/user-id/1423382 <P>&nbsp;</P><P><SPAN><STRONG>Unleash the Power of Real-Time Business Insights with SAP Advanced Event Mesh</STRONG></SPAN></P><P><SPAN><BR />In today's ever-changing business landscape, being able to respond quickly is crucial. SAP Business Technology Platform (BTP) lays the groundwork for this agility by providing a comprehensive integration platform. But what if you could harness the power of instant reactions to every customer interaction? That's where SAP Advanced Event Mesh (AEM) comes in - a revolutionary tool that unlocks the true potential of SAP BTP. By utilizing the event-driven architecture championed by SAP BTP, AEM empowers businesses to make real-time, data-driven decisions - a vital capability in today's fast-paced environment.</SPAN></P><P><SPAN>Imagine a world where every customer interaction triggers an immediate response, enabling businesses to make informed choices in real-time. This is the power of SAP Advanced Event Mesh (AEM), a revolutionary tool that transforms how businesses react to events and unlock hidden opportunities&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</SPAN></P><P style=" text-align: center; "><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Nallam_97_0-1711483863565.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/86952i16E613984B8AA697/image-size/medium?v=v2&amp;px=400" role="button" title="Nallam_97_0-1711483863565.png" alt="Nallam_97_0-1711483863565.png" /></span><SPAN>(Image Source: SAP)</SPAN></P><P style=" text-align: center; ">&nbsp;</P><P><SPAN><STRONG>The Grocery Store Scenario: A Glimpse into the Future of Inventory Management</STRONG></SPAN></P><P><SPAN><BR />Consider a grocery store whe­re every purchase­ instantly triggers an event that is re­layed to a central system. This e­liminates the nee­d for traditional end-of-day reports, allowing for immediate­ insights into:</SPAN></P><UL><LI><SPAN><STRONG>Product popularity:</STRONG> Identify fast-selling items and e­nsure they are always in stock.</SPAN></LI><LI><SPAN><STRONG>Inve­ntory optimization:</STRONG> Replenish stock as soon as it runs low, preve­nting lost sales and customer frustration. </SPAN></LI></UL><P><SPAN>This is just one e­xample of how AEM streamlines busine­ss processes and enable­s proactive decision-making across various industries.</SPAN></P><P><SPAN><STRONG>&nbsp;Ke­y Features of SAP AEM:</STRONG></SPAN></P><UL><LI><SPAN><STRONG>Event-drive­n communication:</STRONG> Respond to events as the­y happen, creating a dynamic and responsive­ system.</SPAN></LI><LI><SPAN><STRONG>Scalability and flexibility:</STRONG> Easily adapt to changing business ne­eds and data volumes. </SPAN></LI><LI><SPAN><STRONG>Unified e­vent management:</STRONG></SPAN><SPAN> Gain ce­ntralized control and visibility over all eve­nts within your SAP landscape. </SPAN></LI><LI><SPAN><STRONG>Seamless inte­gration:</STRONG></SPAN><SPAN> Integrate seamle­ssly with SAP and Non-SAP solutions.<BR /><BR /></SPAN><SPAN><STRONG>Components of SAP AEM:</STRONG></SPAN></LI></UL><P><SPAN><STRONG>&nbsp; &nbsp; &nbsp; &nbsp;Mission Control:</STRONG></SPAN><SPAN> Easily de­ploy and manage event broke­rs, monitor their performance, and visualize­&nbsp; &nbsp; &nbsp; &nbsp;your event-driven archite­cture.</SPAN></P><P><SPAN><STRONG>&nbsp; &nbsp; &nbsp; &nbsp;Event Portal:</STRONG></SPAN><SPAN> Design your e­vent-driven setup using a full se­t of tools, including an overview, designe­r, catalog, and event manager for running e­vents. </SPAN></P><P><SPAN><STRONG>&nbsp; &nbsp; &nbsp; Insights:</STRONG></SPAN><SPAN> Get real-time­ insights into the health and performance­ of your event network, ensuring your applications work well.</SPAN></P><P><SPAN><BR /></SPAN><SPAN><STRONG>&nbsp; &nbsp; &nbsp; Deployment Options:</STRONG> </SPAN></P><P><SPAN><BR />&nbsp; &nbsp; &nbsp; You can choose from diffe­rent deployment options for SAP AEM: </SPAN></P><UL><LI><SPAN><STRONG>Public Re­gions:</STRONG> This allows you to use the infrastructure manage­d by SAP, which is simple and easy to use. </SPAN></LI><LI><SPAN><STRONG>De­dicated Regions:</STRONG></SPAN><SPAN> This gives you more­ control and isolation within a dedicated SAP cloud environme­nt. </SPAN></LI><LI><SPAN><STRONG>Customer-Controlled Regions:</STRONG></SPAN><SPAN> This le­ts you deploy AEM on your own Kubernete­s cluster, giving you ultimate customization and control<BR /><STRONG><BR />&nbsp;Security:</STRONG> </SPAN></LI></UL><P><SPAN>&nbsp; &nbsp; &nbsp; &nbsp;SAP AEM take­s security very seriously at e­very level, with fe­atures like: </SPAN></P><UL><LI><SPAN>Secure­ cloud architecture with various deployme­nt options.</SPAN></LI><LI><SPAN>VPC/VNet isolation for keeping data se­gregated secure­ly.</SPAN></LI><LI><SPAN>Multi-factor authentication and authorization to have comprehe­nsive access control.</SPAN></LI></UL><P>&nbsp;</P> 2024-03-26T03:57:44.968000+01:00 https://community.sap.com/t5/technology-blogs-by-members/groovy-script-to-compare-xml-payloads-in-sap-cpi-part-1/ba-p/13650630 Groovy Script to Compare XML Payloads in SAP CPI - Part 1 2024-03-27T12:08:10.456000+01:00 gaganhl https://community.sap.com/t5/user/viewprofilepage/user-id/154073 <H3 id="toc-hId-1119703555">Introduction:</H3><P>This blog is dedicated to exploring the intricacies of data comparison in SAP CPI implementation scenarios. One of the key challenges in data/message flow optimisation is effectively comparing input payloads. In this blog series, we will focus on comparing two XML payloads, regardless of their structural similarities or differences, with a keen eye on detecting and highlighting data changes.</P><H3 id="toc-hId-923190050">Scenario :</H3><P>In SAP CPI implementation scenarios, comparing input payloads is a crucial factor in data/message flow optimisation. In this blog, we delve into the comparison of two XML payloads. Whether the payloads possess different structures or share a similar structure, the focus remains on detecting data changes between the old and updated versions. Our goal is to highlight the updated data segments, ensuring a streamlined<BR />output.</P><H3 id="toc-hId-726676545">Solution :</H3><P>Leveraging Groovy Script in the Flow for Data Comparison.</P><H3 id="toc-hId-530163040">IFlow Design:</H3><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-22 at 3.58.27 PM.png" style="width: 998px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87325i9B9DFCB80848E455/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-22 at 3.58.27 PM.png" alt="Screenshot 2024-03-22 at 3.58.27 PM.png" /></span></P><UL><LI><STRONG>Content Modifier :</STRONG>&nbsp;We will provide a dataset of employees&nbsp;in the content modifier named as <EM>"Payload input1"</EM>. Below is the sample data provided.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 10.58.43 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87328i18A46433F31F0271/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 10.58.43 PM.png" alt="Screenshot 2024-03-24 at 10.58.43 PM.png" /></span></P><pre class="lia-code-sample language-markup"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;root&gt; &lt;EMPLOYEE&gt; &lt;EMPLOYEE_ID&gt;1001&lt;/EMPLOYEE_ID&gt; &lt;FIRST_NAME&gt;Buggs&lt;/FIRST_NAME&gt; &lt;LAST_NAME&gt;Bunny&lt;/LAST_NAME&gt; &lt;EMAIL&gt;BuggsBunny@abc.com&lt;/EMAIL&gt; &lt;PHONE_NUMBER&gt;212-867-5309&lt;/PHONE_NUMBER&gt; &lt;HIRE_DATE&gt;12 DEC 1985&lt;/HIRE_DATE&gt; &lt;JOB_ID&gt;MD12741&lt;/JOB_ID&gt; &lt;SALARY&gt;4000.00&lt;/SALARY&gt; &lt;COMMISSION_PCT&gt;0.03&lt;/COMMISSION_PCT&gt; &lt;DESIGNATION&gt;Developer&lt;/DESIGNATION&gt; &lt;DEPARTMENT_ID&gt;5341&lt;/DEPARTMENT_ID&gt; &lt;/EMPLOYEE&gt; &lt;EMPLOYEE&gt; &lt;EMPLOYEE_ID&gt;1002&lt;/EMPLOYEE_ID&gt; &lt;FIRST_NAME&gt;Robert&lt;/FIRST_NAME&gt; &lt;LAST_NAME&gt;Jay&lt;/LAST_NAME&gt; &lt;EMAIL&gt;RobertJay@abc.com&lt;/EMAIL&gt; &lt;PHONE_NUMBER&gt;212-867-2345&lt;/PHONE_NUMBER&gt; &lt;HIRE_DATE&gt;02 JAN 1983&lt;/HIRE_DATE&gt; &lt;JOB_ID&gt;MD12742&lt;/JOB_ID&gt; &lt;SALARY&gt;7000.00&lt;/SALARY&gt; &lt;COMMISSION_PCT&gt;0.13&lt;/COMMISSION_PCT&gt; &lt;DESIGNATION&gt;Consultant&lt;/DESIGNATION&gt; &lt;DEPARTMENT_ID&gt;5342&lt;/DEPARTMENT_ID&gt; &lt;/EMPLOYEE&gt; &lt;EMPLOYEE&gt; &lt;EMPLOYEE_ID&gt;1003&lt;/EMPLOYEE_ID&gt; &lt;FIRST_NAME&gt;Tom&lt;/FIRST_NAME&gt; &lt;LAST_NAME&gt;Frank&lt;/LAST_NAME&gt; &lt;EMAIL&gt;TomFrank@abc.com&lt;/EMAIL&gt; &lt;PHONE_NUMBER&gt;212-867-2342&lt;/PHONE_NUMBER&gt; &lt;HIRE_DATE&gt;01 OCT 1980&lt;/HIRE_DATE&gt; &lt;JOB_ID&gt;MD12743&lt;/JOB_ID&gt; &lt;SALARY&gt;10000.00&lt;/SALARY&gt; &lt;COMMISSION_PCT&gt;0.23&lt;/COMMISSION_PCT&gt; &lt;DESIGNATION&gt;Manager&lt;/DESIGNATION&gt; &lt;DEPARTMENT_ID&gt;5343&lt;/DEPARTMENT_ID&gt; &lt;/EMPLOYEE&gt; &lt;/root&gt;​</code></pre><UL><LI><STRONG>Content Modifier :</STRONG>&nbsp;We will declare a property named <EM>"input1"</EM> to store payload1.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 11.02.13 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87331i87D324A32CA5A027/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 11.02.13 PM.png" alt="Screenshot 2024-03-24 at 11.02.13 PM.png" /></span></P><UL><LI><STRONG>Content Modifier :</STRONG>&nbsp;Another dataset of employees will be provided in the content modifier named&nbsp;<EM>"Payload input2"</EM>. However, in this example, the XML data structure is different, and the data has been updated. Below is the sample data provided.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 11.11.23 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87334iA1C0D9D13BFD5B98/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 11.11.23 PM.png" alt="Screenshot 2024-03-24 at 11.11.23 PM.png" /></span></P><P>The salary data of the employee with Employee Id 1003 has been updated from &lt;SALARY&gt;10000.00&lt;/SALARY&gt; to &lt;SALARY&gt;14000.00&lt;/SALARY&gt;.</P><pre class="lia-code-sample language-markup"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;root&gt; &lt;EMPLOYEE&gt; &lt;EMPLOYEE_ID&gt;1002&lt;/EMPLOYEE_ID&gt; &lt;FIRST_NAME&gt;Robert&lt;/FIRST_NAME&gt; &lt;LAST_NAME&gt;Jay&lt;/LAST_NAME&gt; &lt;HIRE_DATE&gt;02 JAN 1983&lt;/HIRE_DATE&gt; &lt;JOB_ID&gt;MD12742&lt;/JOB_ID&gt; &lt;COMMISSION_PCT&gt;0.13&lt;/COMMISSION_PCT&gt; &lt;DESIGNATION&gt;Consultant&lt;/DESIGNATION&gt; &lt;DEPARTMENT_ID&gt;5342&lt;/DEPARTMENT_ID&gt; &lt;EMAIL&gt;RobertJay@abc.com&lt;/EMAIL&gt; &lt;PHONE_NUMBER&gt;212-867-2345&lt;/PHONE_NUMBER&gt; &lt;SALARY&gt;7000.00&lt;/SALARY&gt; &lt;/EMPLOYEE&gt; &lt;EMPLOYEE&gt; &lt;EMPLOYEE_ID&gt;1001&lt;/EMPLOYEE_ID&gt; &lt;FIRST_NAME&gt;Buggs&lt;/FIRST_NAME&gt; &lt;LAST_NAME&gt;Bunny&lt;/LAST_NAME&gt; &lt;HIRE_DATE&gt;12 DEC 1985&lt;/HIRE_DATE&gt; &lt;JOB_ID&gt;MD12741&lt;/JOB_ID&gt; &lt;COMMISSION_PCT&gt;0.03&lt;/COMMISSION_PCT&gt; &lt;DESIGNATION&gt;Developer&lt;/DESIGNATION&gt; &lt;DEPARTMENT_ID&gt;5341&lt;/DEPARTMENT_ID&gt; &lt;EMAIL&gt;BuggsBunny@abc.com&lt;/EMAIL&gt; &lt;PHONE_NUMBER&gt;212-867-5309&lt;/PHONE_NUMBER&gt; &lt;SALARY&gt;4000.00&lt;/SALARY&gt; &lt;/EMPLOYEE&gt; &lt;EMPLOYEE&gt; &lt;EMPLOYEE_ID&gt;1003&lt;/EMPLOYEE_ID&gt; &lt;FIRST_NAME&gt;Tom&lt;/FIRST_NAME&gt; &lt;LAST_NAME&gt;Frank&lt;/LAST_NAME&gt; &lt;HIRE_DATE&gt;01 OCT 1980&lt;/HIRE_DATE&gt; &lt;JOB_ID&gt;MD12743&lt;/JOB_ID&gt; &lt;COMMISSION_PCT&gt;0.23&lt;/COMMISSION_PCT&gt; &lt;DESIGNATION&gt;General Manager&lt;/DESIGNATION&gt; &lt;DEPARTMENT_ID&gt;5343&lt;/DEPARTMENT_ID&gt; &lt;EMAIL&gt;TomFrank@abc.com&lt;/EMAIL&gt; &lt;PHONE_NUMBER&gt;212-867-2342&lt;/PHONE_NUMBER&gt; &lt;SALARY&gt;14000.00&lt;/SALARY&gt; &lt;/EMPLOYEE&gt; &lt;/root&gt;</code></pre><UL><LI><STRONG>Content Modifier :</STRONG>&nbsp;We will declare a property named <EM>"input2"</EM> to store payload2.&nbsp;</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 11.16.13 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87340iB41AD6F8CBC5EF18/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 11.16.13 PM.png" alt="Screenshot 2024-03-24 at 11.16.13 PM.png" /></span></P><UL><LI><STRONG>Groovy Script :</STRONG>&nbsp;The Groovy script below compares the data of both payload1 and payload2 based on the Employee Id, which is the unique data identifier. It then returns only the dataset that has been updated or modified compared to the previous data.</LI></UL><pre class="lia-code-sample language-javascript"><code>import com.sap.gateway.ip.core.customdev.util.Message; import java.util.HashMap; import groovy.util.XmlSlurper; import groovy.xml.MarkupBuilder; def Message processData(Message message) { def input1 = message.getProperty("input1") def input2 = message.getProperty("input2") def xml1 = new XmlSlurper().parseText(input1) def xml2 = new XmlSlurper().parseText(input2) def changedData = [] xml1.EMPLOYEE.each { row1 -&gt; def matchingRow = xml2.EMPLOYEE.find { row2 -&gt; row1.EMPLOYEE_ID.text() == row2.EMPLOYEE_ID.text() } if (matchingRow) { def diff = false row1.children().each { element -&gt; def correspondingElement = matchingRow."${element.name()}" if (element.text() != correspondingElement.text()) { diff = true } } if (diff) { changedData &lt;&lt; matchingRow } } } def resultXml = new StringWriter() def xmlBuilder = new MarkupBuilder(resultXml) xmlBuilder.root { changedData.each { changedRow -&gt; EMPLOYEE { changedRow.children().each { element -&gt; "${element.name()}"(changedRow."${element.name()}".text()) } } } } message.setBody(resultXml.toString()) return message; }</code></pre><H3 id="toc-hId-333649535">Result&nbsp;:</H3><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-24 at 11.45.38 PM.png" style="width: 998px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87341iDFCD5D2FBBBC857E/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-24 at 11.45.38 PM.png" alt="Screenshot 2024-03-24 at 11.45.38 PM.png" /></span></P><P>In conclusion, the output of using Groovy script in the flow for comparing data contains the data of the employee whose dataset has been updated. This approach not only streamlines data comparison processes but also ensures that only relevant and updated information is highlighted, contributing to efficient data/message flow management.</P><P>&nbsp;</P><P>Thanks and Regards,<BR />Gagan H L</P> 2024-03-27T12:08:10.456000+01:00 https://community.sap.com/t5/financial-management-blogs-by-sap/integrating-custom-references-with-sales-billing-by-extending-the/ba-p/13618985 Integrating Custom References with Sales Billing by Extending the Integration Flow 2024-03-27T14:05:15.640000+01:00 KatherineW https://community.sap.com/t5/user/viewprofilepage/user-id/13062 <H2 id="toc-hId-987168123"><SPAN class=""><SPAN class="">Introduction</SPAN></SPAN></H2><P style=" text-align : left; "><SPAN class=""><SPAN class="">You might already know </SPAN><SPAN class="">that you&nbsp;</SPAN><SPAN class="">can</SPAN><SPAN class=""> store </SPAN><SPAN class="">references to related data, such as external documents</SPAN><SPAN class="">, in </SPAN><SPAN class="">SAP Subscription Billing by defining custom references</SPAN><SPAN class="">. But did you know that </SPAN><SPAN class="">you can transfer&nbsp;</SPAN><SPAN class="">those </SPAN><SPAN class="">custom references </SPAN><SPAN class="">to Sal</SPAN><SPAN class="">es Billing </SPAN><SPAN class="">in </SPAN><SPAN class="">SAP S/4HANA Cloud </SPAN><SPAN class="">and display them</SPAN><SPAN class="">&nbsp;</SPAN><SPAN class="">on </SPAN><SPAN class="">customer </SPAN><SPAN class="">invoice</SPAN><SPAN class="">s</SPAN><SPAN class="">? In this blog </SPAN><SPAN class="">we’ll</SPAN><SPAN class=""> walk </SPAN><SPAN class="">you </SPAN><SPAN class="">through the steps to set this up.</SPAN></SPAN><SPAN class="">&nbsp;</SPAN></P><H4 id="toc-hId-1048820056"><SPAN class=""><SPAN class=""><SPAN class="">Example</SPAN><SPAN class=""> Use Case</SPAN></SPAN></SPAN></H4><P style=" text-align : left; "><SPAN>You want to enter purchase order references in subscriptions and include those references in the items of billing document requests so the references can be displayed on invoices generated in SAP S/4HANA Cloud.</SPAN><SPAN>&nbsp;</SPAN></P><P style=" text-align : left; "><SPAN>Before we dive into the setup, here’s a short summary of the concepts:</SPAN><SPAN>&nbsp;</SPAN></P><H4 id="toc-hId-852306551"><SPAN><SPAN class=""><SPAN class="">Custom References and Custom Fields</SPAN></SPAN></SPAN></H4><UL><LI>Billing data in SAP Subscription Billing includes custom references that originate in subscriptions or in customer or product data.&nbsp;&nbsp;</LI><LI>Custom references from SAP Subscription Billing can be mapped to custom fields in SAP S/4HANA Cloud, as we’ll describe in this blog post. <SPAN>&nbsp;</SPAN></LI></UL><P style=" text-align : left; "><SPAN>To find out more, browse the following documentation on the SAP Help Portal:</SPAN><SPAN>&nbsp;<BR /></SPAN><A href="https://help.sap.com/docs/CLOUD_TO_CASH_OD/e4aa21cd43494cc1a8a90ea0f3dab8bb/1a8601ce8db44b2b8e29012d385892ca.html" target="_blank" rel="noopener noreferrer"><SPAN>Custom References</SPAN></A>&nbsp;| <A href="https://help.sap.com/docs/SAP_S4HANA_CLOUD/0f69f8fb28ac4bf48d2b57b9637e81fa/ce819b8557194ae0aa180ba4ac6a04de.html" target="_blank" rel="noopener noreferrer"><SPAN>Custom Fields</SPAN></A></P><H4 id="toc-hId-655793046"><SPAN><SPAN class=""><SPAN class="">Custom Integration Flows in </SPAN><SPAN class="">SAP Cloud Integration</SPAN></SPAN></SPAN></H4><P style=" text-align : left; "><SPAN>SAP provides standard integration flows that define aspects such as mapping and routing for data integrations. As a customer or partner, you can extend these integration flows, for example to adapt the way data is replicated or to include additional data in replication. If you want to dig into the details of</SPAN>&nbsp;custom integration flows, refer to&nbsp;<A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/integration-flow-extension-concepts" target="_blank" rel="noopener noreferrer">Integration Flow – Concepts</A>&nbsp;on the SAP Help Portal.&nbsp;</P><P style=" text-align : left; "><SPAN>For our example, we’ll show how to extend the integration flow used to transfer bills from SAP Subscription Billing to SAP S/4HANA Cloud.&nbsp;</SPAN></P><P><SPAN>&nbsp;</SPAN><SPAN>&nbsp;</SPAN></P><H2 id="toc-hId-201114103"><SPAN><SPAN class="">Configuration Steps</SPAN></SPAN></H2><OL><LI><SPAN>Configure custom fields in SAP S/4HANA Cloud.</SPAN></LI><LI><SPAN>Define and use custom references in SAP Subscription Billing.</SPAN></LI><LI><SPAN>Extend the standard integration flow in SAP Cloud Integration.</SPAN></LI><LI><SPAN>Check that the integration is working correctly.</SPAN></LI></OL><H3 id="toc-hId-133683317"><SPAN><SPAN class=""><SPAN class=""><SPAN class="">1. Configur</SPAN><SPAN class="">e</SPAN> <SPAN class="">c</SPAN><SPAN class="">ustom </SPAN><SPAN class="">f</SPAN><SPAN class="">ields in SAP S/4HANA Cloud</SPAN></SPAN></SPAN></SPAN></H3><H5 id="toc-hId-195335250"><SPAN><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">Create a custom field</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></H5><P>To create a customer field, you need a role with all the following business catalogs:</P><UL><LI>SAP_CORE_BC_EXT_BLE</LI><LI>SAP_CORE_BC_EXT_FLD</LI><LI>SAP_CORE_BC_EXT_FLEX</LI></UL><P>Open the <STRONG>Custom Fields</STRONG> app and create a custom field <STRONG>Purchase Order.&nbsp;</STRONG>The business context must be <EM>Sales: Billing Document Item (SD_BILLINGDOCITEM)</EM>.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1_1_CustomFields_AddField.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87349iE1F5779939B7017E/image-size/large?v=v2&amp;px=999" role="button" title="1_1_CustomFields_AddField.jpg" alt="1_1_CustomFields_AddField.jpg" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1_2_PurchaseOrder2.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87353i1A14CD72B6076B15/image-size/large?v=v2&amp;px=999" role="button" title="1_2_PurchaseOrder2.jpg" alt="1_2_PurchaseOrder2.jpg" /></span></P><P>&nbsp;<span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1_2_PurchaseOrder1.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87355iC58C8D91ECB866AD/image-size/large?v=v2&amp;px=999" role="button" title="1_2_PurchaseOrder1.jpg" alt="1_2_PurchaseOrder1.jpg" /></span></P><H5 id="toc-hId--1178255">&nbsp;<SPAN>Adapt the user interface to show the new custom field</SPAN></H5><OL><LI><SPAN><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">In the <STRONG>Manage Billing Document Requests</STRONG> app, display a billing document request. Choose the billing document request number to navigate to the <STRONG>Billing Document Requests</STRONG> app. Choose the user option to adapt the UI:</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1_2_1_AdaptUI.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/81420iED6594E3F40EDE48/image-size/large?v=v2&amp;px=999" role="button" title="1_2_1_AdaptUI.jpg" alt="1_2_1_AdaptUI.jpg" /></span><BR /><BR /></LI><LI><SPAN><SPAN class=""><SPAN class="">Search for the field </SPAN></SPAN><STRONG><SPAN class=""><SPAN class="">Purchase Order</SPAN></SPAN></STRONG><SPAN class=""><SPAN class=""> and select it:<BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1_2_2_AdaptUI.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/81425i4589CE7016600600/image-size/large?v=v2&amp;px=999" role="button" title="1_2_2_AdaptUI.jpg" alt="1_2_2_AdaptUI.jpg" /></span><BR /><BR /></SPAN></SPAN></SPAN></LI><LI><SPAN><SPAN class=""><SPAN class="">The field <STRONG>Purchase Order</STRONG> appears on the billing document request item:<BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1_2_3_AdaptUI.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/81493iCD00D8DE3B40A627/image-size/large?v=v2&amp;px=999" role="button" title="1_2_3_AdaptUI.jpg" alt="1_2_3_AdaptUI.jpg" /></span></SPAN></SPAN></SPAN></LI></OL><P>&nbsp;</P><H3 id="toc-hId--455857198"><SPAN>2. Define and use custom references in SAP Subscription Billing</SPAN></H3><OL><LI><SPAN><SPAN><SPAN class=""><SPAN class="">Open the </SPAN></SPAN><STRONG><SPAN class=""><SPAN class="">Manage Business Configuration</SPAN></SPAN></STRONG><SPAN class=""><SPAN class=""> app</SPAN><SPAN class="">, go to </SPAN></SPAN><STRONG><SPAN class=""><SPAN class="">Custom References</SPAN></SPAN></STRONG><SPAN class=""> <SPAN class="">and </SPAN><SPAN class="">define a custom reference for the purchase order. Enable the field for subscriptions and bill items:</SPAN></SPAN><SPAN class=""><SPAN class="">&nbsp;</SPAN></SPAN></SPAN></SPAN><SPAN><SPAN><SPAN class=""><SPAN class=""><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="2_BusConfig.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71061iF19EE3B549AF249D/image-size/large?v=v2&amp;px=999" role="button" title="2_BusConfig.jpg" alt="2_BusConfig.jpg" /></span><BR /></SPAN></SPAN></SPAN></SPAN></LI><LI><SPAN><SPAN><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">Open the </SPAN></SPAN><STRONG><SPAN class=""><SPAN class="">Manage Subscriptions</SPAN></SPAN></STRONG><SPAN class=""> <SPAN class="">app, open a subscription, and</SPAN><SPAN class=""> navigate to </SPAN></SPAN><STRONG><SPAN class=""><SPAN class="">Custom R</SPAN><SPAN class="">e</SPAN><SPAN class="">ferences</SPAN></SPAN></STRONG><SPAN class=""><SPAN class="">.</SPAN></SPAN><SPAN class=""><SPAN class="">&nbsp;Find the </SPAN><SPAN class="">custom reference type </SPAN></SPAN><STRONG><SPAN class=""><SPAN class="">Purchase Order</SPAN></SPAN></STRONG><SPAN class=""><SPAN class="">&nbsp;and </SPAN><SPAN class="">enter </SPAN><SPAN class="">a purchase order ID/number:<BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="2_Subscription.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71296i5BCA96B3ADA77260/image-size/large?v=v2&amp;px=999" role="button" title="2_Subscription.jpg" alt="2_Subscription.jpg" /></span><BR /></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></LI><LI><SPAN><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">When a bill is generated for the subscription, the bill item&nbsp;</SPAN><SPAN class="">contains</SPAN><SPAN class=""> the custom reference for the purchase order:<BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="2_Subscription.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71062iA1DB1A40EA990996/image-size/large?v=v2&amp;px=999" role="button" title="2_Subscription.jpg" alt="2_Subscription.jpg" /></span></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></LI></OL><P>&nbsp;</P><H3 id="toc-hId--652370703"><SPAN class="">3. Extend the standard </SPAN><SPAN class="">i</SPAN><SPAN class="">ntegration </SPAN><SPAN class="">f</SPAN><SPAN class="">low in </SPAN><SPAN class="">SAP </SPAN><SPAN class="">C</SPAN><SPAN class="">loud Integration</SPAN></H3><P style=" text-align : left; "><SPAN>To modify the message mapping of the standard integration flow to include the purchase order field, the following steps are required in SAP Cloud Integration:</SPAN><SPAN>&nbsp;</SPAN></P><OL><LI><SPAN>Download the standard message mapping</SPAN><SPAN>&nbsp;</SPAN></LI><LI><SPAN>Check the post-exit processing in the standard integration flow</SPAN></LI><LI><SPAN>Create a custom integration flow</SPAN></LI><LI><SPAN>Enable the extension in the standard integration flow</SPAN><SPAN>&nbsp;</SPAN></LI></OL><H5 id="toc-hId--1510921591"><SPAN>Download the standard message mapping</SPAN></H5><P style=" text-align : left; "><SPAN><SPAN class=""><SPAN class="">Start by downloading the standard message mapping from the standard integration flow</SPAN> </SPAN><STRONG><SPAN class=""><SPAN class="">Transfer Bills to SAP S4HANA Cloud</SPAN></SPAN></STRONG><SPAN class=""><SPAN class="">.</SPAN></SPAN><SPAN class=""><SPAN class="">&nbsp;</SPAN></SPAN><SPAN class=""><SPAN class="">Y</SPAN><SPAN class="">ou need the message mapping to add it your </SPAN><SPAN class="">custom</SPAN><SPAN class=""> integration</SPAN><SPAN class=""> flow later, where you ca</SPAN><SPAN class="">n </SPAN><SPAN class="">modi</SPAN><SPAN class="">fy</SPAN><SPAN class=""> the mapping.</SPAN></SPAN></SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_1_DownloadMapping.jpg" style="width: 0px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71153i608FF8C6C9D4266E/image-size/small?v=v2&amp;px=200" width="0" height="0" role="button" title="3_1_DownloadMapping.jpg" alt="3_1_DownloadMapping.jpg" /></span></P><H5 id="toc-hId--1707435096"><SPAN>Check the post-exit processing in the standard integration flow</SPAN></H5><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_2_PostProcessingStep.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71162i7243B33E9CC55D83/image-size/large?v=v2&amp;px=999" role="button" title="3_2_PostProcessingStep.jpg" alt="3_2_PostProcessingStep.jpg" /></span></P><P style=" text-align : left; "><SPAN class=""><SPAN class="">In the </SPAN><SPAN class="">post-exit</SPAN> <SPAN class="">p</SPAN><SPAN class="">rocessing step</SPAN><SPAN class=""> (</SPAN></SPAN><SPAN class=""><SPAN class=""><STRONG>Post Processing</STRONG></SPAN></SPAN><SPAN class=""><SPAN class="">)</SPAN><SPAN class="">, </SPAN><SPAN class="">display the details of </SPAN><SPAN class="">the </SPAN></SPAN><STRONG><SPAN class=""><SPAN class="">Bundle Message</SPAN></SPAN></STRONG><SPAN class=""><SPAN class=""> step</SPAN><SPAN class="">:</SPAN></SPAN><SPAN class="">&nbsp;</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_3_MessageBody.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71171i7BC1700271A9F79B/image-size/large?v=v2&amp;px=999" role="button" title="3_3_MessageBody.jpg" alt="3_3_MessageBody.jpg" /></span></SPAN></P><P style=" text-align : left; ">&nbsp;<SPAN>This step creates a new payload that contains the following:</SPAN><SPAN>&nbsp;</SPAN></P><UL style=" text-align : left; "><LI><SPAN>The original bill and customer payload</SPAN><SPAN>&nbsp;</SPAN></LI><LI><SPAN>The message mapping output</SPAN></LI></UL><P style=" text-align : left; ">This payload will be passed from the standard integration flow to your custom integration flow.<SPAN>&nbsp;</SPAN><SPAN>To find out more about post-exits, see </SPAN><A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/integration-flow-extension-concepts#customer-exits" target="_blank" rel="noopener noreferrer"><SPAN>Customer Exits</SPAN></A><SPAN> in the SAP Cloud Integration documentation.</SPAN><SPAN>&nbsp;</SPAN></P><H5 id="toc-hId--1903948601"><SPAN>Create a custom integration flow</SPAN></H5><OL><LI><SPAN><SPAN><SPAN class=""><SPAN class="">Create a </SPAN><SPAN class="">custom</SPAN><SPAN class=""> i</SPAN><SPAN class="">ntegration flow</SPAN><SPAN class=""> with </SPAN><SPAN class="">the </SPAN><SPAN class="">ProcessDirect</SPAN><SPAN class=""> adapter and configure an </SPAN><SPAN class="">a</SPAN><SPAN class="">ddress</SPAN><SPAN class="">:</SPAN></SPAN></SPAN></SPAN><SPAN><SPAN><SPAN class=""> </SPAN></SPAN></SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_4_CustomIFlow_Address.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71313i4227D5FA2BE49870/image-size/large?v=v2&amp;px=999" role="button" title="3_4_CustomIFlow_Address.jpg" alt="3_4_CustomIFlow_Address.jpg" /></span><P><SPAN class="">Next&nbsp;</SPAN><SPAN class="">we’ll</SPAN><SPAN class=""> customize the </SPAN><SPAN class="">post-exit</SPAN><SPAN class=""> integration flow.<BR /><BR /></SPAN></P></LI><LI><SPAN><SPAN><SPAN class=""><SPAN class=""><SPAN class="">Enter the following namespace mapping:</SPAN></SPAN><SPAN class=""><SPAN class="">&nbsp;</SPAN><BR /></SPAN><FONT face="courier new,courier"><SPAN class=""><SPAN class="">xmlns:ns</SPAN><SPAN class="">1=<A href="http://sap.com/xi/XI/SplitAndMerge" target="_blank" rel="noopener noreferrer">http://sap.com/xi/XI/SplitAndMerge</A><BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_5_CustomIFlow_NamespaceMapping.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71180i458A40E21B4AA389/image-size/large?v=v2&amp;px=999" role="button" title="3_5_CustomIFlow_NamespaceMapping.jpg" alt="3_5_CustomIFlow_NamespaceMapping.jpg" /></span><BR /></SPAN></SPAN></FONT></SPAN></SPAN></SPAN></LI><LI>Add a filter to get the original bill response, which is the source of the message mapping:&nbsp;<SPAN><SPAN><SPAN class=""><FONT face="courier new,courier"><SPAN class=""><SPAN class=""><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_6_CustomIFlow_Filter.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71187iB67B6821E5BD5016/image-size/large?v=v2&amp;px=999" role="button" title="3_6_CustomIFlow_Filter.jpg" alt="3_6_CustomIFlow_Filter.jpg" /></span></SPAN></SPAN></FONT></SPAN></SPAN></SPAN></LI><LI><P style=" text-align : left; ">Upload the message mapping from the standard integration flow:</P><SPAN><SPAN><SPAN class=""><FONT face="courier new,courier"><SPAN class=""><SPAN class=""><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_7_CustomIFlow_MessageMapping.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71188iCCF5B6D28A45F38E/image-size/large?v=v2&amp;px=999" role="button" title="3_7_CustomIFlow_MessageMapping.jpg" alt="3_7_CustomIFlow_MessageMapping.jpg" /></span></SPAN></SPAN></FONT></SPAN></SPAN></SPAN></LI><LI><P style=" text-align : left; ">Download the latest WSDL file from the communication arrangement SAP_COM_0095 and upload it to the custom integration flow:</P><SPAN><SPAN class=""><FONT face="courier new,courier"><SPAN class=""><SPAN class=""><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_8_CommsArrangmentWDSL.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71233iCC1B1D94D9316E81/image-size/large?v=v2&amp;px=999" role="button" title="3_8_CommsArrangmentWDSL.jpg" alt="3_8_CommsArrangmentWDSL.jpg" /></span></SPAN></SPAN></FONT></SPAN></SPAN><SPAN><SPAN><SPAN class=""><FONT face="courier new,courier"><SPAN class=""><SPAN class=""><BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3_9_CommsArrangmentWDSL.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/81502iED4AC2DEC89D8D1D/image-size/large?v=v2&amp;px=999" role="button" title="3_9_CommsArrangmentWDSL.jpg" alt="3_9_CommsArrangmentWDSL.jpg" /></span><BR /><BR /></SPAN></SPAN></FONT></SPAN></SPAN></SPAN></LI><LI>Modify the message mapping in the custom integration flow for the <EM>purchase order</EM> field. Map the custom reference ID to it:<BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_9_MessageMapping.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/81498iF7A3C7DD05A84F7B/image-size/large?v=v2&amp;px=999" role="button" title="3_9_MessageMapping.jpg" alt="3_9_MessageMapping.jpg" /></span><P>&nbsp;</P></LI><LI><SPAN>Deploy the custom integration flow.</SPAN><SPAN>&nbsp;<BR /></SPAN></LI></OL><H5 id="toc-hId--2100462106"><SPAN class="">Enable the extension in the standard integration flow</SPAN></H5><OL><LI><SPAN><SPAN>Configure the standard integration flow:<BR /></SPAN></SPAN><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_91_CustomIFlow_Implemented.jpg" style="width: 862px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/81503iE6450CD35489DCBC/image-size/large?v=v2&amp;px=999" role="button" title="3_91_CustomIFlow_Implemented.jpg" alt="3_91_CustomIFlow_Implemented.jpg" /></span></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3_92_CustomIFlow_ReceiverAddress.jpg" style="width: 720px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/81505i848A85699075ED89/image-size/large?v=v2&amp;px=999" role="button" title="3_92_CustomIFlow_ReceiverAddress.jpg" alt="3_92_CustomIFlow_ReceiverAddress.jpg" /></span></SPAN></P><P>&nbsp;<span class="lia-unicode-emoji" title=":information:">ℹ️</span><SPAN>&nbsp;</SPAN><SPAN class="">The&nbsp;</SPAN><SPAN class="">a</SPAN><SPAN class="">ddress</SPAN><SPAN class="">&nbsp;must be the same as the&nbsp;</SPAN><SPAN class="">address</SPAN><SPAN class="">&nbsp;configured in the custom&nbsp;</SPAN><SPAN class="">i</SPAN><SPAN class="">ntegration flow.<BR /><BR /></SPAN></P></LI><LI><SPAN class=""><SPAN class="">Deploy the standard </SPAN><SPAN class="">i</SPAN><SPAN class="">ntegration flow.</SPAN></SPAN><SPAN class="">&nbsp;</SPAN></LI></OL><H3 id="toc-hId--1710169597"><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">4. Check that </SPAN><SPAN class="">the integration is </SPAN><SPAN class="">working correctly</SPAN></SPAN><SPAN class="">&nbsp;</SPAN></SPAN></SPAN></SPAN></H3><P style=" text-align : left; "><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">After</SPAN><SPAN class=""> the next transfer of billing data to </SPAN></SPAN><SPAN class=""><SPAN class="">SAP S/4HANA Cloud, </SPAN><SPAN class="">you see a </SPAN><SPAN class="">reference</SPAN><SPAN class=""> to the subscription billing document request in the </SPAN></SPAN><STRONG><SPAN class=""><SPAN class="">Manage Billing Data</SPAN></SPAN></STRONG><SPAN class=""><SPAN class=""> app:</SPAN></SPAN></SPAN></SPAN></P><P style=" text-align: center; "><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="4_SBDR.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71239iE991507D4360293A/image-size/large?v=v2&amp;px=999" role="button" title="4_SBDR.jpg" alt="4_SBDR.jpg" /></span></SPAN></SPAN></SPAN></SPAN></P><P style=" text-align : left; "><SPAN class=""><SPAN class="">When you click on the</SPAN><SPAN class=""> document ID, you jump into the billing document request item, where you can see that the </SPAN><SPAN class="">purchase order is displayed</SPAN><SPAN class="">:</SPAN></SPAN><SPAN class=""><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="4_BillDocRequestItem.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/71241i9F4F9E9612AED91C/image-size/large?v=v2&amp;px=999" role="button" title="4_BillDocRequestItem.jpg" alt="4_BillDocRequestItem.jpg" /></span></SPAN></P><P style=" text-align : left; "><STRONG><span class="lia-unicode-emoji" title=":chequered_flag:">🏁</span>You've now completed the setup and can include custom references in your customer invoices.&nbsp;</STRONG></P><H2 id="toc-hId--1613280095">More Information&nbsp;</H2><UL><LI><A href="https://help.sap.com/docs/CLOUD_TO_CASH_OD/a78a4be305be4dbc903bd826a1aba456/faae2ec156cf44ada9ced90713a63828.html" target="_blank" rel="noopener noreferrer"><SPAN>Subscription Management with Sales Billing</SPAN></A><SPAN>&nbsp;</SPAN></LI><LI><A href="https://help.sap.com/docs/btp/sap-fiori-launchpad-for-sap-btp/adapting-sap-fiori-uis-at-runtime-key-user-adaptation" target="_blank" rel="noopener noreferrer"><SPAN>Adapting SAP Fiori UIs at Runtime</SPAN></A><SPAN>&nbsp;</SPAN></LI><LI><A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/integration-flow-extension-concepts" target="_self" rel="noopener noreferrer">SAP Cloud Integration - Integration Flow Extension</A><SPAN>&nbsp;</SPAN></LI><LI><A href="https://help.sap.com/docs/CLOUD_TO_CASH_OD" target="_blank" rel="noopener noreferrer"><SPAN>SAP Subscription Billing</SPAN></A><SPAN>&nbsp;</SPAN></LI><LI><A href="https://help.sap.com/docs/SAP_S4HANA_CLOUD/a376cd9ea00d476b96f18dea1247e6a5/4c74c957b7018809e10000000a4450e5.html" target="_self" rel="noopener noreferrer"><SPAN>SAP S/4HANA Cloud Sales Billing</SPAN></A><SPAN>&nbsp;</SPAN></LI></UL> 2024-03-27T14:05:15.640000+01:00 https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-advanced-event-mesh-adapter-client-certificate-aem/ba-p/13651318 Cloud Integration: Advanced Event Mesh Adapter, Client Certificate, AEM 2024-03-27T16:13:19.536000+01:00 CarlosRoggan https://community.sap.com/t5/user/viewprofilepage/user-id/5495 <P><STRONG>SAP Cloud Integration</STRONG> (aka CPI) offers an “Advanced Event Mesh Adapter” which is well integrated with the “Advanced Event Mesh” broker.<BR />This article shows how to set up a scenario where we send a message from iFlow via “Advanced Event Mesh Adapter” to <STRONG>SAP Cloud Integration, Advanced Event Mesh (AEM)</STRONG>&nbsp;with <STRONG>Client Certificate</STRONG> Authentication.<BR />Please refer to the <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-1-intro/ba-p/13644191" target="_blank">sibling article series</A> which describes in detail the setup for "AMQP Adapter".<BR />The creation of a certificate chain is equal in both scenarios.<BR />The configuration in AEM is also same as in Solace.<BR />So basically, in this blog post we only need to show the configuration in the “Advanced Event Mesh” (AEM) adapter.</P><H2 id="toc-hId-990647690">Overview</H2><OL><LI>Introduction</LI><LI>Create Client Certificate</LI><LI>Configure AEM</LI><LI>Create iFlow</LI><LI>Run Scenario</LI><LI>Key Takeaways</LI></OL><H2 id="toc-hId-794134185">Prerequisites</H2><P data-unlink="true"><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>To follow this tutorial, access to&nbsp;&nbsp;<A href="http:// https://help.sap.com/docs/SAP_ADVANCED_EVENT_MESH" target="_blank" rel="noopener nofollow noreferrer">SAP Advanced Event Mesh</A>&nbsp;is required.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Access To CPI Tenant is required<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>I recommend bookmarking the <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-btp-security-glossary/ba-p/13562676" target="_blank">Security Glossary</A></P><H2 id="toc-hId-597620680">1. Introduction</H2><P>We want to send a message from an iFlow to Advanced Event Mesh Broker.<BR />We want to use the “Advanced Event Mesh” adapter.<BR />Authentication should be configured with <STRONG>client certificate</STRONG>.</P><P>There’s a sibling blog post which uses the AMQP adapter for the same use case.<BR />Almost all steps are equal and <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-1-intro/ba-p/13644191" target="_blank">described in detail there</A>.</P><P><FONT color="#999999">What is the scenario?</FONT><BR />This is the high-level overview of the simple scenario:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diagram_aem.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/97652iD852622C928107BD/image-size/large?v=v2&amp;px=999" role="button" title="diagram_aem.jpg" alt="diagram_aem.jpg" /></span></P><P>We can see that the iFlow sends messages via "Advanced Event Mesh adapter" to a queue in Advanced Event Mesh.<BR />On both sides, certificates have to be configured.</P><P><FONT color="#999999">How to get certificates?</FONT><BR />The <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-2/ba-p/13646997" target="_blank">sibling article series</A> explains in detail multiple ways of generating certificates for this purpose.<BR />To give an overview of some possibilities:</P><P><U><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Use CPI Keystore dashboard</U></P><P>1. Create key pair / certificate in CPI<BR />&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Use it as self-signed root in our scenario<BR />&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Download the corresponding CSR (certificate signing request) and create a self-signed chain on laptop<BR />&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Download the CSR and use it to purchase a productive chain from productive CA<BR />2. Download existing CPI client certificate chain and use it for our scenario</P><P><U><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Use Laptop</U></P><P>-&gt; Create key pair / certificate ourselves on laptop<BR />&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Use Openssl<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Create self-signed root or chain (chain with different length)<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&nbsp;Create CSR and purchase productive chain<BR />&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Use Java Keytool<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - etc<BR />&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Use any other tool<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - etc</P><P><U><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Use BTP</U></P><P>-&gt; let service broker or IAs generate key pair / certificate chain and use that for our scenario</P><P>Alternatively, there are tools in the internet and for download, to handle such tasks.<BR />In the present tutorial, we’re going the easy way and use a CPI-generated certificate.<BR />I recommend however going through the experience of <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-2/ba-p/13646997" target="_blank">creating certificate chain</A> on local computer.</P><H2 id="toc-hId-401107175">2. Create Client Certificate</H2><P>Using the built-in functionality of CPI to generate a key pair has the following advantage:<BR />The private key is generated at CPI, where it is needed.<BR />The private key never leaves CPI (it is not possible to download it)<BR />The private key does not need to be uploaded to CPI via net.<BR />The disadvantage would be that this private key cannot be used locally, as it is not possible to&nbsp; download it.</P><P>For today’s article, we’re using the CPI keystore to create a self-signed certificate.<BR />This will serve as trusted root certificate at AEM-side, and it will be used as client-certificate in iFlow.</P><P><U>Ceate Key Pair in CPI</U></P><P>We go to keystore and choose "Create -&gt; Key Pair"<BR />We enter some data of your choice, e.g.<BR />&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Alias: &nbsp;“demokeypair”<BR />&nbsp; &nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>CN: “demokeypair”</P><P>It will be used for creating the certificate.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="createKeyPair.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87468iE2C179FCC7A83475/image-size/medium?v=v2&amp;px=400" role="button" title="createKeyPair.jpg" alt="createKeyPair.jpg" /></span></P><P>&nbsp;After creation, we click on the new entry I the dashboard to view the details:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="createKeyPair2.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87469i978B324F162533CC/image-size/medium?v=v2&amp;px=400" role="button" title="createKeyPair2.jpg" alt="createKeyPair2.jpg" /></span></P><P>&nbsp;</P><P>We can see that a self-signed certificate has been created.<BR />If subject and issuer DN are equal, then this means it is a root certificate.</P><P>Now we can download the new certificate via context button and “Download Certificate”<BR />In my example, a file <FONT face="courier new,courier">demokeypair.cer</FONT> is downloaded to my laptop.</P><P>Note:<BR />If you encounter a <FONT face="courier new,courier">.p7b</FONT> file after download artifacts, you can extract it with the help of OpenSSL and the <A href="http://www.openssl.org/docs/apps/pkcs7.html" target="_blank" rel="noopener nofollow noreferrer">pkcs7</A> command.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-bash"><code>openssl pkcs7 -in demokeypair.p7b -print_certs -out certificate.cer</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><H2 id="toc-hId-204593670">3. Configure Advanced Event Mesh</H2><P>Now that we have the client certificate, we can establish trust at AEM side.<BR />This means:<BR />AEM receives an authentication request with a client certificate.<BR />It must validate the certificate.<BR />It must trust it.</P><P>To do so, the signature of the issuer is checked – and the issuer itself – continuing the chain up to the root.<BR />If the root is not known by AEM, then it has to be configured.<BR />As such, we have to upload our certificate (which is a root as well) to AEM.</P><P>See <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-3-solace/ba-p/13647051" target="_blank">sibling blog post</A> for detailed description.</P><P><U>3.1. Upload Root Certificate</U></P><P>We go to “Cluster Manager” <span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>&nbsp;Event Broker service instance&nbsp;<span class="lia-unicode-emoji" title=":right_arrow:">➡️</span> &nbsp;“Manage” tab.<BR /><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>click “Certificate Authorities” and upload the root certificate from previous chapter.<BR />In my example, we upload the <FONT face="courier new,courier">demokeypair.cer</FONT> file.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aem_cert1.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/97658i9361726085465CCD/image-size/medium?v=v2&amp;px=400" role="button" title="aem_cert1.jpg" alt="aem_cert1.jpg" /></span></P><P><U>3.2. Authorization for Client</U></P><P>We go to “Cluster Manager”&nbsp;<SPAN><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>&nbsp;</SPAN>Event Broker service instance&nbsp;<SPAN><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>&nbsp;</SPAN> “Open Broker Manager”.<BR /><SPAN><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>&nbsp;</SPAN> “Access Control”&nbsp;<SPAN><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>&nbsp;</SPAN>“Client Usernames”.<BR />Create new client username and enter the value of the “CN” of our client certificate from previous chapter.<BR />In my example: “demokeypair”</P><P><SPAN><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>&nbsp;Press “Create”.<BR /></SPAN><SPAN><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>&nbsp;</SPAN><SPAN>Press “Enable”.<BR /></SPAN><SPAN><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span></SPAN><SPAN>&nbsp;Press “Apply”.</SPAN></P><P><U>3.3. Create Queue</U></P><P>We're still in the “Broker Manager”, so now we choose “Queues” on the left navigation pane.<BR />Then we create a new queue&nbsp; and enter a name of our choice, e.g. “demo”</P><P><U>3.4. Connection Details</U></P><P>To find the connection details that we need in the next chapter, we go to<BR />&nbsp;“Cluster Manager”&nbsp;<SPAN><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>&nbsp;</SPAN>Event Broker service instance <SPAN><span class="lia-unicode-emoji" title=":right_arrow:">➡️</span>&nbsp;</SPAN>“Connect” tab.<BR />Expand “Solace Messaging” section (SMF over TCP).<BR />Copy the “Message VPN” and “SMF Host”:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="solace_connection.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87461i085CDCD706CC13DA/image-size/medium?v=v2&amp;px=400" role="button" title="solace_connection.jpg" alt="solace_connection.jpg" /></span></P><H2 id="toc-hId-8080165">4. Create iFlow</H2><P>We create a very simple iFlow that does nothing than sending an empty message to Advanced Event Mesh.<BR />See <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-4-iflow/ba-p/13647065" target="_blank">sibling blog post</A> for some more description.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iflow1.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87465iB0775545142BA695/image-size/medium?v=v2&amp;px=400" role="button" title="iflow1.jpg" alt="iflow1.jpg" /></span></P><P>Other than in sibling post, we use the “Advanced Event Mesh” adapter.</P><P><U>Configure Advanced Event Mesh adapter<BR /></U><FONT face="courier new,courier"><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>URL</FONT><U><BR /></U>We need to enter the full URL of the SMF host, which we copied in previous chapter.<BR />Including protocol and port.<BR />Just copy&amp;paste from AEM dashboard (previous chapter).<BR /><FONT face="courier new,courier"><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Message VPN</FONT><BR />The Message VPN can also be copied from AEM.<BR /><FONT face="courier new,courier"><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Username</FONT><BR />The Username “default” can be used, as it is available on AEM as per default.<BR />But any other existing username can be entered here as well.<BR /><FONT face="courier new,courier"><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Keystore Alias</FONT><BR />The Keystore Alias must point to a key pair entry.<BR />It is checked during deployment.<BR />In our example, we enter the key pair which we created in chapter above: “demokeypair”</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iflow2.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87466iF43CC16518B380EB/image-size/medium?v=v2&amp;px=400" role="button" title="iflow2.jpg" alt="iflow2.jpg" /></span></P><P>In the “Processing” Tab, we choose “Queue” and enter the name of the queue we created above:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iflow3.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/87467i09A6FA7861344BD1/image-size/medium?v=v2&amp;px=400" role="button" title="iflow3.jpg" alt="iflow3.jpg" /></span></P><P>That’s it, we can save the iFlow.</P><H2 id="toc-hId--188433340">5. Run Scenario</H2><P>To run the scenario we just deploy the iFlow.<BR />Then we check the result:<BR />In CPI : The log at “Monitor Message Processing” should show success message.<BR />In event broker: The number of “Messages Queued” should have increased.</P><H2 id="toc-hId--384946845">6. Quick Guide</H2><P><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Certificate Chain:<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>The intermediate certificate must have <FONT face="courier new,courier">CA:TRUE</FONT><BR />&nbsp; &nbsp;&nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>The chain order: <EM>Root Rear.</EM><BR /><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>AEM:<BR /><SPAN>&nbsp; &nbsp;&nbsp;</SPAN><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span><SPAN>Upload the root cert.<BR /></SPAN>&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Create username equal to “CN”.<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Username must be set to "Enabled".<BR /><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>CPI:<BR />&nbsp; &nbsp; <span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Upload the chain, not only client cert.<BR />&nbsp; &nbsp; &nbsp; &nbsp; Reason: the whole chain must be sent to AEM, as at AEM only the root is known.</P><H2 id="toc-hId--581460350">Summary</H2><P>In this blog post we’ve learned how to deal with client certificates.<BR />We wanted to use certificate-based authentication instead of username / password (Basic Auth).<BR />To do so, we learned how to easily get a key pair and a certificate.<BR />To establish trust, we need to &nbsp;configure the target server (AEM) with the trusted root certificate.<BR />Finally, we can use the certificate in CPI, which means, it is stored in the Keystore and used in the iflow.<BR />In this blog post, we’ve learned how to configure the Advanced Event Mesh adapter.<BR />There’s a <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-1-intro/ba-p/13644191" target="_blank">sibling article series</A> which explains many details about certificates.</P><H2 id="toc-hId--777973855">Links</H2><P>SAP Help Portal&nbsp;landing page : <A href="https://help.sap.com/docs/SAP_ADVANCED_EVENT_MESH" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/SAP_ADVANCED_EVENT_MESH</A><BR />Documentation entry page:&nbsp;<A href="https://help.pubsub.em.services.cloud.sap/Cloud/cloud-lp.htm" target="_blank" rel="noopener nofollow noreferrer">https://help.pubsub.em.services.cloud.sap/Cloud/cloud-lp.htm</A></P><P style=" text-align: center; "><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span><span class="lia-unicode-emoji" title=":party_popper:">🎉</span></P> 2024-03-27T16:13:19.536000+01:00 https://community.sap.com/t5/technology-blogs-by-sap/new-partner-content-on-sap-business-accelerator-hub-q1-24/ba-p/13656895 New Partner Content on SAP Business Accelerator Hub (Q1 ’24) 2024-04-03T10:59:59.828000+02:00 AnanthNatarajan https://community.sap.com/t5/user/viewprofilepage/user-id/79594 <P><SPAN>As a continuation of the previous&nbsp;<A href="https://community.sap.com/t5/technology-blogs-by-sap/new-partner-content-on-sap-business-accelerator-hub-q4-23/ba-p/13572884" target="_self">blog<SPAN>,</SPAN></A>&nbsp;we would like to provide further updates and keep up the momentum of sharing relevant information with our community.</SPAN></P><P><SPAN>In this blog series, learn about the new content published on <A href="https://hub.sap.com/" target="_self" rel="noopener noreferrer">SAP Business Accelerator Hub</A> from our partners during <STRONG>Q1 '2024</STRONG>, along with their high-level details.</SPAN></P><P><SPAN>For complete details on each partner's content, refer to the <A href="https://hub.sap.com/allpartners" target="_self" rel="noopener noreferrer">partners listing</A> which is available on the home page of SAP Business Accelerator Hub.</SPAN></P><P><SPAN>-----------------------------------------------------------------------------------------------------------------------------------------------</SPAN></P><H3 id="toc-hId-1119884414"><STRONG>Flexso NV</STRONG></H3><P>Flexso specializes in advanced SAP solutions, driving innovation and efficiency for your business. We blend your goals with our expertise, offering a comprehensive suite of services including SAP S/4HANA, HR digitalization, customer experience enhancement, and more. As a proactive partner, we focus on transforming your business for agility and future readiness, ensuring you stay ahead in a rapidly evolving digital world. Choose Flexso for smart solutions and a partnership that leads to success.</P><H4 id="toc-hId-1052453628"><STRONG>Integration Content published:</STRONG></H4><P style=" padding-left : 30px; "><A href="https://hub.sap.com/package/ShopifyIntegrationwithSAPS4HANACloud/overview" target="_self" rel="noopener noreferrer"><SPAN>Shopify Integration with SAP S/4HANA Cloud</SPAN></A></P><DIV class=""><DIV class=""><DIV>&nbsp;</DIV><DIV><SPAN><SPAN>The Shopify to SAP S/4HANA Integration Package is a comprehensive solution designed to seamlessly connect your e-commerce and ERP systems. It leverages webhooks for real-time data synchronization, enhancing operational efficiency and data accuracy.</SPAN></SPAN><DIV class="">&nbsp;<DIV><SPAN><SPAN>-----------------------------------------------------------------------------------------------------------------------------------------------</SPAN></SPAN></DIV><DIV>&nbsp;</DIV><DIV><STRONG>Effective People A/S</STRONG><DIV><P>At Effective People, our purpose is people. As a leading global provider of SAP SuccessFactors, HR advisory, and workforce management solutions, Effective People helps organizations across all territories and industries to drive better business outcomes, improve HR effectiveness, streamline payroll processes, and create great employee experiences. We've completed more than 1,000 SAP SuccessFactors projects in more than 100 countries worldwide throughout the past 18+ years. Our 250 consultants cover all major industries and provide continued operational support and maintenance for more than 150 companies. We're in the SAP Hall of Fame and have been awarded Expert status in SAP's Competency Framework. Together with our customers, we've won 13 SAP Quality Awards, and received the Partner Excellence Award in 2020 and 2021.</P><H4 id="toc-hId-855940123"><STRONG>Integration Content published:</STRONG></H4><P style=" padding-left : 30px; "><A href="https://hub.sap.com/package/SAPSuccessFactorsEmployeeCentralIntegrationwithSAPConcur/overview" target="_self" rel="noopener noreferrer"><SPAN>SAP SuccessFactors Employee Central Integration with SAP Concur</SPAN></A></P><P style=" padding-left : 30px; "><SPAN>SAP SuccessFactors Employee Central Integration with SAP Concur enables the replication of employee data from SAP SuccessFactors Employee Central to SAP Concur.</SPAN></P><DIV class="">&nbsp;<DIV class="">-----------------------------------------------------------------------------------------------------------------------------------------------<H3 id="toc-hId-530343899"><STRONG><SPAN>NTT DATA Business Solutions AG</SPAN></STRONG></H3><P>We understand the business of our clients and know what it takes to transform it into the future. At NTT DATA Business Solutions AG, we drive innovation for more than 30 years - from advisory and implementation to managed services and beyond; we continuously improve SAP solutions and technology to make them work for companies - and for their people.</P><H4 id="toc-hId-462913113"><STRONG>Integration Content published:</STRONG></H4><P style=" padding-left : 30px; "><A href="https://hub.sap.com/package/SAPLeanIXIntegrationwithSAPIntegrationSuite/overview" target="_self" rel="noopener noreferrer"><SPAN>SAP LeanIX Integration with SAP Integration Suite</SPAN></A></P><P style=" padding-left : 30px; "><SPAN>This integration package is designed to synchronize data between SAP LeanIX and Integration Assessment, focusing primarily on application and vendor information. Utilizing the powerful capabilities of the SAP Integration Suite, this synchronization process ensures a seamless, secure, and up-to-date data flow. This enhances the accuracy and efficiency of IT integration strategies, providing comprehensive insights for integration assessments.</SPAN></P><P><SPAN>-----------------------------------------------------------------------------------------------------------------------------------------------</SPAN></P><H3 id="toc-hId-137316889"><STRONG><SPAN>eMudhra Technologies Limited</SPAN></STRONG></H3><P>eMudhra recognizes the importance of robust digital security. We're here to guide you through our specialized solutions for digital security and identity management.</P><H4 id="toc-hId-69886103"><STRONG>API Content published:</STRONG></H4><P style=" padding-left : 30px; "><A href="https://hub.sap.com/package/emSigner/overview" target="_self" rel="noopener noreferrer">emSigner</A></P><P style=" padding-left : 30px; "><SPAN>This package supports different signature types and ensures robust security measures, making it an ideal solution for diverse sectors. By streamlining document signing workflows, it not only automates processes but also reduces paperwork significantly.</SPAN></P><P><SPAN>------------------------------------------------------------------------------------------------------------------------------------------</SPAN></P><P><SPAN>If you are interested in&nbsp;<STRONG>Partnering with SAP Business Accelerator Hub, </STRONG>please refer to this <A href="https://hub.sap.com/partnerwithus" target="_self" rel="noopener noreferrer">section</A> and <A href="https://discovery-center.cloud.sap/missiondetail/4378/" target="_self" rel="nofollow noopener noreferrer">discover center mission</A> for more details.&nbsp;</SPAN></P><P><SPAN>Stay tuned for further updates and information by the end of the next quarter!</SPAN></P></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV> 2024-04-03T10:59:59.828000+02:00 https://community.sap.com/t5/enterprise-architecture-blog-posts/workday-integration-with-btp-cloud-integration-btp-ci-sap-cpi-through-oauth/ba-p/13631308 Workday Integration with BTP Cloud integration (BTP CI / SAP CPI) through OAuth 2.0 Authentication 2024-04-04T13:20:17.586000+02:00 Prabhugoud_Gogi https://community.sap.com/t5/user/viewprofilepage/user-id/648404 <P><STRONG>Introduction</STRONG>:</P><P>Recently I got a requirement where BTP CI/SAP CPI should integration with workday using OAuth 2.0 authentication and replicate master data / transactional data from S/4HANA to Workday by consuming workday webservice's, since BTP CI workday adapter supports only basic authentication as a workaround solution to authenticate via OAuth 2.0.</P><P><STRONG>Prerequisite:</STRONG></P><OL><LI>Workday authentication details like Token URL, client ID, Client Secret, refresh token with required roles/permissions (read/write).</LI><LI>Check workday webservices are up and running.</LI></OL><P>I assume that you have any workday webservice to test.</P><P>&nbsp;</P><P><STRONG>Steps:</STRONG></P><P>Below is the sample integration design to post cost center in workday through OAuth 2.0 authentication.</P><P><STRONG><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sample Iflow.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/77546i16DEA8D5BAD1DB8A/image-size/large?v=v2&amp;px=999" role="button" title="sample Iflow.jpg" alt="sample Iflow.jpg" /></span></STRONG></P><P><STRONG>Step 1:</STRONG> Get Access token using Token URL, client_id, client_secret, refresh_token.</P><UL class="lia-list-style-type-square"><LI>Set the header with parameter <STRONG>Content-Type</STRONG> with the value “<STRONG>application/x-www-form-urlencoded</STRONG>” and configure the connection like below to get a token.</LI><LI>Adding client_id and client_secret in basic user credentials of security material.</LI><LI>Set Body with refresh_token and grant_type</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Security Material.jpg" style="width: 661px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/77548iA79461168B79B76A/image-size/large?v=v2&amp;px=999" role="button" title="Security Material.jpg" alt="Security Material.jpg" /></span></P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="set Content Type.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/77550i0CD5BD36F98FAEF9/image-size/large?v=v2&amp;px=999" role="button" title="set Content Type.jpg" alt="set Content Type.jpg" /></span></P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="set body.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/77551i2E91B2AD84993DE6/image-size/large?v=v2&amp;px=999" role="button" title="set body.jpg" alt="set body.jpg" /></span><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="http_connection.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/77552iEE507A43B1359B65/image-size/large?v=v2&amp;px=999" role="button" title="http_connection.jpg" alt="http_connection.jpg" /></span></P><P>&nbsp;</P><P><STRONG>Step 2:</STRONG></P><P>Once we get a token, set it in the header of type Bearer.</P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="set token.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/77557iD99510452F34A66E/image-size/large?v=v2&amp;px=999" role="button" title="set token.jpg" alt="set token.jpg" /></span></P><P><STRONG>Step 3:</STRONG>&nbsp; Call workday web service to post data.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="call webservice.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/77561iF32177A4730AC0F0/image-size/large?v=v2&amp;px=999" role="button" title="call webservice.jpg" alt="call webservice.jpg" /></span></P><P>Hope you find this article helpful and if you have any suggestion and comments, please reply to the Comments section below.</P><P><STRONG>Reference Links:</STRONG></P><UL><LI><A href="https://community.workday.com/sites/default/files/file-hosting/productionapi/Financial_Management/v41.2/Financial_Management.html" target="_blank" rel="nofollow noopener noreferrer">https://community.workday.com/sites/default/files/file-hosting/productionapi/Financial_Management/v41.2/Financial_Management.html</A></LI><LI><A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/workday-receiver-adapter" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/cloud-integration/sap-cloud-integration/workday-receiver-adapter</A></LI></UL><P>!!! Happy Learning !!!</P><P>&nbsp;</P><P>Best regards,</P><P>Prabhugoud Gogi</P><P>&nbsp;</P> 2024-04-04T13:20:17.586000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/single-sign-on-to-sap-cloud-integration-cpi-runtime-from-an-external/ba-p/13655108 Single Sign On to SAP Cloud Integration (CPI runtime) from an external Identity Provider 2024-04-11T06:53:39.270000+02:00 vinayak_adkoli https://community.sap.com/t5/user/viewprofilepage/user-id/216068 <H2 id="toc-hId-990764901"><STRONG>Introduction:</STRONG></H2><P>Yes, you read it right (and you read it right here !). There is an <U>out-of-the-box</U> approach to achieving a single sign-on (SSO) experience for user flows between a corporate identity provider (that authenticates and authorizes the user) and a tenant of Cloud Integration runtime (loosely called CPI worker) fully within the BTP ecosystem.</P><P>Ok, let’s zoom out a bit and break this down.</P><P>If you are reading this blog post, you probably know already that SAP BTP Services can leverage the <U>OpenID Connect</U> federation-based mechanics of SAP Cloud Identity Service (read: SAP IAS) to connect users from corporate Identity Providers like Entra ID (formerly known as Azure AD), Okta, etc. to XSUAA BTP’s OAuth Authorization Server.<BR />This is certainly not uncharted and I did a detailed <A href="https://community.sap.com/t5/technology-blogs-by-sap/single-sign-on-to-sap-integration-suite-sap-api-business-hub-enterprise-via/ba-p/13573716" target="_self">blog post</A> a few months ago demonstrating this setup.</P><P>However, this setup applied mostly to browser-based SaaS applications (<EM>read</EM>: Design Time applications with a web frontend), and that brings us to the objective of this blog -&gt; Customers want to put together a similar setup for their client applications that interface with SAP Cloud Integration’s IFLows (in other words, the CPI runtime).<BR />Certainly, this is not impossible to achieve and solution blueprints like these have existed in the past:</P><UL><LI>My colleague Francisco’s <A href="https://community.sap.com/t5/technology-blogs-by-sap/principal-propagation-in-sap-integration-suite-from-external-system-to-an/ba-p/13543111" target="_blank">blog</A> puts API Management in between a client and Cloud Integration and enforces API Management to perform an OAuthSAMLBearer handshake.</LI><LI>Microsoft champion Martin Raepple <A href="https://community.sap.com/t5/technology-blogs-by-members/principal-propagation-in-a-multi-cloud-solution-between-microsoft-azure-and/ba-p/13479950" target="_blank">teaches</A> how to set up SAML Trust between Entra ID Identity Provider and BTP to set up a user impersonation flow.</LI></UL><P>However, these approaches were often seen as cumbersome to set up / troubleshoot and certainly not for the faint-hearted!</P><H2 id="toc-hId-794251396"><STRONG>Solution Summary:</STRONG></H2><P>An easier solution can be described in two phrases: '<FONT face="terminal,monaco" color="#993366">OpenID Connect</FONT>' and '<FONT face="terminal,monaco" color="#993366">Authorization Code</FONT> grant type'. If you are super-smart then you've figured it out already. You can stop reading this blog and hack this yourself.<BR />I wish you a nice day ahead! If you are like me and need a bit more explanation, keep reading <span class="lia-unicode-emoji" title=":slightly_smiling_face:">🙂</span></P><P>Here is the solution blueprint that explains that handshake:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture1.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/93034i23EDF7DB077BF799/image-size/large?v=v2&amp;px=999" role="button" title="Picture1.png" alt="Picture1.png" /></span></P><P style=" text-align: center; "><FONT size="2"><EM><STRONG>SCENARIO</STRONG>: Flows that require end-user authentication from external Identity Providers can natively do so with OIDC and Authorization Code grant type</EM></FONT></P><P><STRONG>Step 0:</STRONG> Generate Service Instance / Service Key SAP Cloud Integration Runtime. Refer to <A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/specifying-service-instance-and-service-key-parameters-in-json-format" target="_self" rel="noopener noreferrer">this</A> link. Instead of <FONT face="terminal,monaco" color="#993366">Client Credentials</FONT>&nbsp;make sure to select&nbsp; <FONT face="terminal,monaco" size="3" color="#993366">Authorization Code</FONT>.</P><P><STRONG>Step 1:</STRONG> Onboard the needed corporate identity providers in SAP IAS and set up the 'Application' that connects back to your SAP BTP Subaccount as a <U>Trusted Identity Provider</U> via OpenID Connect. Refer to my <A href="https://community.sap.com/t5/technology-blogs-by-sap/single-sign-on-to-sap-integration-suite-sap-api-business-hub-enterprise-via/ba-p/13573716" target="_blank">previous</A> blog post for a detailed procedure.&nbsp;</P><P><STRONG>Step 2:</STRONG> Client (end-user)&nbsp; initiates a connection to the required IFlow (or API artifact). This kicks off the 3-legged OAuth user login flow.</P><P data-unlink="true"><STRONG>Step 3:</STRONG> As the user is not signed in, she is redirected to XSUAA's login endpoint, and upon login the IAS tenant's&nbsp;<SPAN>&nbsp;OAuth server authorization endpoint at&nbsp;</SPAN><EM>https://&lt;IAS&nbsp;<SPAN>&nbsp;</SPAN>tenant name&gt;.accounts.ondemand.com</EM><EM>/oauth2/authorize </EM>is invoked using the authorization code grant type. The details of the actual federation as part of the handshake have been omitted here for simplicity. But suffice it to say that the authorization code from the identity provider is made available to the IAS's callback endpoint and finally made available to XSUAA's authorize endpoint and exchanged for the actual access token. This access token will bear the user's scopes and role permissions needed to access the Cloud Integration's IFlow resource.&nbsp;</P><P><STRONG>Step 4:</STRONG> Once successfully authorized, on the receiver side of the IFlow, we will establish connections to 3 different types of backends for illustration purposes. <U>a)</U> S/4HANA Onpremise system over Cloud Connector and Principal Propagation <U>b)</U> SuccessFactors and <U>c)</U> S/4HANA Cloud with <U>OAuth2 SAMLBearer</U> Assertion security material.&nbsp;</P><H2 id="toc-hId-597737891">Putting it all together:</H2><P>Let's get our hands dirty by putting together the sequence now. The prerequisites to follow along are listed below:</P><UL><LI>Administrator privileges in the BTP subaccount where the Integration Suite subscription exists.</LI><LI>An IAS Tenant (with Administrator privileges) that can be coupled (<EM>read</EM>: Trusted) with the said BTP Subaccount.</LI><LI>Privileges to create Applications (<EM>read</EM>: IDP configurations) in Entra ID (Azure AD) and/or Okta.</LI><LI>Postman Client.</LI><LI>Backend systems to which the frontend user principal can be propagated to. Either of S/4HANA OnPrem, S/4HANA Cloud, or SuccessFactors tenant.</LI></UL><H3 id="toc-hId-530307105"><SPAN>Step 0: Create a Service Instance for the Authorization Code grant type</SPAN></H3><P><SPAN>Create an instance of the '<U>Process Integration Runtime</U>' Service (integration-flow service plan)&nbsp; specifically with the <FONT face="terminal,monaco" color="#993366">authorization code</FONT> grant type. You can copy the JSON snippet pasted below. Do not worry about the location of the <FONT face="terminal,monaco" color="#993366">redirect_uri</FONT>. (When we get down to testing the flow, the browser will invoke the redirect_uri, but this has no consequence as the 'code' will be available for us to copy as a query parameter from the URL itself. When we test this from Postman the client, Postman does not invoke the URL. If you are curious to know, you can read about it <A href="https://stackoverflow.com/questions/62760501/how-does-postman-handle-localhost-oauth-2-redirects" target="_self" rel="nofollow noopener noreferrer">here</A>.) Also, make a note that we have specified <FONT face="terminal,monaco" color="#993366">refresh_token</FONT> as part of the requested grant type. This will let us demonstrate the ability for clients to refresh the access token post-expiry.&nbsp;</SPAN></P><P>&nbsp;</P><pre class="lia-code-sample language-json"><code>{ "grant-types": [ "refresh_token", "authorization_code" ], "redirect-uris": [ "http://localhost" ], "roles": [ "ESBMessaging.send" ] }</code></pre><P>&nbsp;</P><P>With the service instance created, generate a service key (example block is pasted below). Grab the <FONT face="terminal,monaco" color="#993366">clientid</FONT>, <FONT face="terminal,monaco" color="#993366">clientsecret</FONT>, <FONT face="terminal,monaco" color="#993366">authorizationurl</FONT>, <FONT face="terminal,monaco" color="#993366">tokenurl</FONT> attributes. We will need these later.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-05 at 8.58.50 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92480iC725C39BBB316413/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-05 at 8.58.50 PM.png" alt="Screenshot 2024-04-05 at 8.58.50 PM.png" /></span></P><P>&nbsp;</P><H3 id="toc-hId-333793600">Step 1: Configure OpenID Connect based Trusted Identity Provider of SAP IAS in your SAP BTP subaccount</H3><P>This step is the <EM>heart-and-soul</EM> of our approach. We will couple an SAP IAS tenant with our BTP subaccount that has the subscription of our SAP Cloud Integration (SAP Integration Suite) tenant using OpenID Connect protocol and then onboard the desired external Identity Providers (I will demonstrate Entra ID and Okta) as corporate identity providers in the IAS administration console.<BR />Since I've documented the steps in my previous blog, I will not repeat the exact steps here. Please refer to the following sections in the <A href="https://community.sap.com/t5/technology-blogs-by-sap/single-sign-on-to-sap-integration-suite-sap-api-business-hub-enterprise-via/ba-p/13573716" target="_self">linked</A> blog.</P><P>&nbsp;</P><TABLE border="1" width="100%"><TBODY><TR><TD width="45.2319587628866%" height="30px"><STRONG>Objective</STRONG></TD><TD width="54.7680412371134%" height="30px"><STRONG>Steps to follow from the linked blog</STRONG></TD></TR><TR><TD width="45.2319587628866%" height="57px"><SPAN>Couple your BTP subaccount and your SAP IAS tenant.</SPAN></TD><TD width="54.7680412371134%" height="57px">Steps 1-6</TD></TR><TR><TD width="45.2319587628866%" height="85px"><SPAN>Configure applications (relying party) in Azure AD and Okta IDP based on OpenID Connect and SAP IAS as the callback URI.</SPAN></TD><TD width="54.7680412371134%" height="85px">Steps&nbsp;<SPAN>7 - 25</SPAN></TD></TR><TR><TD width="45.2319587628866%" height="57px"><SPAN>Configure application in Okta with SAML Trust to SAP IAS.</SPAN></TD><TD width="54.7680412371134%" height="57px">Steps <SPAN>26 - 33</SPAN></TD></TR><TR><TD width="45.2319587628866%" height="57px"><SPAN>Onboard the above Corporate Identity Provider configurations into SAP IAS.</SPAN><SPAN><BR /></SPAN></TD><TD width="54.7680412371134%" height="57px">Steps <SPAN>34 - 46</SPAN></TD></TR><TR><TD width="45.2319587628866%" height="57px"><SPAN>configure IAS as the proxy Identity Provider and SAP BTP as the Service Provider.</SPAN></TD><TD width="54.7680412371134%" height="57px">Steps <SPAN>47 - 52</SPAN></TD></TR></TBODY></TABLE><P>Nevertheless, here is a summary of the main steps involved in the setup.</P><P>1. The subaccount where the Integration Suite subscription exists has a 'Trusted connection' with the OpenID Connect protocol (not SAML) to the IAS tenant.</P><H3 id="toc-hId-137280095"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 9.54.43 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92370i2923FA725D32E9FB/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 9.54.43 PM.png" alt="Screenshot 2024-04-06 at 9.54.43 PM.png" /></span></H3><P>2. The IAS tenant has a '<U>Corporate Identity provider</U>' connection to Azure AD (Entra ID) via a set of Application credentials and OpenID Connect protocol.</P><H3 id="toc-hId--59233410"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 9.38.55 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92371i46791EF93D74A62B/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 9.38.55 PM.png" alt="Screenshot 2024-04-06 at 9.38.55 PM.png" /></span></H3><H3 id="toc-hId--255746915">&nbsp;</H3><P>3. Notice the '<U>Application</U>' settings on the <U>Azure</U> side. The redirect URI has been set to the IAS tenant's '<FONT face="terminal,monaco" color="#993366">../oath2/callback</FONT>' segment</P><H3 id="toc-hId--452260420"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 9.36.29 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92373i509F15FCA90FD4E7/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 9.36.29 PM.png" alt="Screenshot 2024-04-06 at 9.36.29 PM.png" /></span></H3><P>4.&nbsp;The IAS tenant has a '<U>Corporate Identity provider</U>' connection to <U>Okta IDP</U> via a set of Application credentials and OpenID Connect protocol.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 9.39.59 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92432i776D80A7FA5F374B/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 9.39.59 PM.png" alt="Screenshot 2024-04-06 at 9.39.59 PM.png" /></span></P><P>&nbsp;</P><P>5. Notice the '<U>Application</U>' settings on the Okta side. The redirect URI has been set to the IAS tenant's '<FONT face="terminal,monaco" color="#993366">../oath2/callback</FONT>' segment.</P><H3 id="toc-hId--648773925"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 9.37.38 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92374i81E6E2901B08DC4C/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 9.37.38 PM.png" alt="Screenshot 2024-04-06 at 9.37.38 PM.png" /></span></H3><P>6. We will not leverage this flow in our demonstration but note that it is very much possible to use <U>SAML bindings</U> between the Corporate Identity Provider and IAS. The federation works exactly as OIDC.</P><H3 id="toc-hId--920518799"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 10.45.14 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92375iD2A2E55CFA07BCE7/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 10.45.14 PM.png" alt="Screenshot 2024-04-06 at 10.45.14 PM.png" /></span></H3><P>&nbsp;</P><P>7. Next, we want to demonstrate a dynamic / Group assertion / <U>Role Collection</U> based user role/authorization determination. For that note that on the Azure side, we have a group called '<U>IntegrationDevelopers</U>' that contains the users who must be authorized to call the IFlow / API on the Cloud Integration side.&nbsp;</P><H3 id="toc-hId--1117032304"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 9.46.09 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92376i8C5DCA173138645F/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 9.46.09 PM.png" alt="Screenshot 2024-04-06 at 9.46.09 PM.png" /></span></H3><P>8. Notice how the 'g<U>roups</U>' claim on the IAS side resolves to the value of the group from Azure.</P><H3 id="toc-hId--1313545809"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 9.44.09 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92378iBDD9051E0C87D093/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 9.44.09 PM.png" alt="Screenshot 2024-04-06 at 9.44.09 PM.png" /></span></H3><P>9. Similarly, see that the target user has been assigned to the '<U>IntegrationSuiteDevelopers'</U>&nbsp;Group in Okta.</P><H3 id="toc-hId--1510059314"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 9.41.35 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92379iCF54AEA938541828/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 9.41.35 PM.png" alt="Screenshot 2024-04-06 at 9.41.35 PM.png" /></span></H3><P>10. Okta presents the user's '<U>Groups</U>' claim to IAS that XSUAA will resolve in a later step.&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 9.44.47 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92453iC8468488FC669780/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 9.44.47 PM.png" alt="Screenshot 2024-04-06 at 9.44.47 PM.png" /></span></P><P>11. As a last configuration step, notice that there is a RoleCollection on the BTP side (with the '<U>MessagingSend</U>' role assigned) mapped to the respective groups from the source identity providers.</P><H3 id="toc-hId--1706572819"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-06 at 10.16.35 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92380iC7EA847196B55E73/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-06 at 10.16.35 PM.png" alt="Screenshot 2024-04-06 at 10.16.35 PM.png" /></span></H3><P>&nbsp;</P><H3 id="toc-hId--1903086324">Step 2 &amp; 3: Initiate the client flow.</H3><P>The easiest way to demonstrate a client flow is to do so in <U>Postman</U> which natively supports simulating an OAuth 2.0 3-legged Authorization Code grant flow. We can break down the segments of the 3-legged flow in a <U>browser</U> as well. I will demonstrate both of these user agents.</P><P>Summary of the steps about to be performed in this section</P><TABLE border="1" width="100%"><TBODY><TR><TD width="50%"><STRONG>Objective</STRONG></TD><TD width="50%"><STRONG>Steps</STRONG></TD></TR><TR><TD width="50%">Use Postman to set up Authorization Code flow with Okta Identity Provider</TD><TD width="50%">1-8</TD></TR><TR><TD>Use Postman to set up Authorization Code flow with Entra ID Identity Provider</TD><TD>9</TD></TR><TR><TD width="50%">Usage of Refresh Tokens</TD><TD width="50%">13-14</TD></TR><TR><TD>Use Browser to set up Authorization code flow with Identity Providers</TD><TD>15-18</TD></TR></TBODY></TABLE><P>1. Within the '<FONT face="terminal,monaco" color="#993366">Authorization</FONT>' tab in Postman, set the '<FONT face="terminal,monaco" color="#993366">Type</FONT>' to '<FONT face="terminal,monaco" color="#993366">OAuth 2.0</FONT>' and the '<FONT face="terminal,monaco" color="#993366">Grant type</FONT>' to '<FONT face="terminal,monaco" color="#993366">Authorization Code</FONT>'.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.15.05 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92461i98EB5D2D021225FD/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.15.05 AM.png" alt="Screenshot 2024-04-07 at 11.15.05 AM.png" /></span></P><P>2. Enter the values for the <FONT face="terminal,monaco"><FONT color="#993366">Callback URL</FONT>, <FONT color="#993366">Auth URL</FONT>, <FONT color="#993366">Access Token URL</FONT>, <FONT color="#993366">Client ID</FONT>, <FONT color="#993366">Client Secret</FONT></FONT>&nbsp;from the values saved in the Step 0 block above.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.15.39 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92468i5508D569B3F6918F/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.15.39 AM.png" alt="Screenshot 2024-04-07 at 11.15.39 AM.png" /></span></P><P>3. Click on '<U>Get New Access Token</U>'. Make sure to turn on the '<U>Console</U>' tab at the bottom to keep track of requests and responses across the wire.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.16.06 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92470iD8B6C992154608E8/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.16.06 AM.png" alt="Screenshot 2024-04-07 at 11.16.06 AM.png" /></span></P><P>4. Postman will launch the Logon pop-up from BTP's Authorization Server. Notice that you are presented with a list of Identity Providers to log into as configured in BTP's Trust Management section. Select the one that corresponds to your IAS Tenant.<BR />Pay attention to the GET requests in the Console tab. You will see that the request to the 'authorize' resource is being redirected to the login page.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.16.34 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92471i6DDB9ED43F11866D/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.16.34 AM.png" alt="Screenshot 2024-04-07 at 11.16.34 AM.png" /></span></P><P>5. The system will prompt you to present the user identifier, this will serve as an input to the 'Conditional Authentication' block set in the IAS tenant to resolve which corporate identity provider to redirect to, for the user logon challenge.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.16.57 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92472i5D854A4F4A5EE4E0/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.16.57 AM.png" alt="Screenshot 2024-04-07 at 11.16.57 AM.png" /></span></P><P>6. The system determines that the challenge should come from Okta IDP for my <EM>*.sap.com</EM> user name. Please refer to the '<U>Conditional Authentication</U>' screenshot to get a summary of the determination process.<BR />In the 'Console' section, make a note of how the callbacks are handled.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Conditional Authentication section in SAP IAS" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94888i08E3F205BCA248EF/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-10 at 9.32.30 PM.png" alt="Conditional Authentication section in SAP IAS" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Conditional Authentication section in SAP IAS</span></span></P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.17.19 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92473i7BA023461B56F428/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.17.19 AM.png" alt="Screenshot 2024-04-07 at 11.17.19 AM.png" /></span></P><P>7. Okta will authenticate the user and present back the '<FONT face="terminal,monaco" color="#993366">authorization code</FONT>' to IAS.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.17.23 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92474iEAFD77C181E2CDBC/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.17.23 AM.png" alt="Screenshot 2024-04-07 at 11.17.23 AM.png" /></span></P><P>8. Finally the client will exchange the authorization code for the <FONT face="terminal,monaco" color="#993366">access token</FONT> from the configured token endpoint.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.17.30 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92475i3FCE2A6A26E6ECB8/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.17.30 AM.png" alt="Screenshot 2024-04-07 at 11.17.30 AM.png" /></span></P><P>9. Let us now perform steps nos. 3-8 again, but this time let us log in with our <EM>*.outlook.com</EM> user that gets authenticated and authorized from Entra ID (Azure AD).</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-08 at 5.57.54 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/93040i2DB4528BC41E8F77/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-08 at 5.57.54 PM.png" alt="Screenshot 2024-04-08 at 5.57.54 PM.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-08 at 5.55.56 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/93041iFDA69D400BF70E20/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-08 at 5.55.56 PM.png" alt="Screenshot 2024-04-08 at 5.55.56 PM.png" /></span></P><P>10. Upon inspection, you will note that the access token issued by XSUAA has the '<FONT face="terminal,monaco" color="#993366">ESBMessaging.send</FONT>' scope as determined by the '<FONT face="terminal,monaco" color="#993366">Groups</FONT>' claim presented by the source IDP. You will remember that we created a mapping for this resolution in a previous step. Also, note that the system bears a <FONT face="terminal,monaco" color="#993366">refresh_token</FONT>.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.17.51 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92476i13000808DE7417E9/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.17.51 AM.png" alt="Screenshot 2024-04-07 at 11.17.51 AM.png" /></span></P><P>11. Further, if you inspect the respective JWTs issued by Okta and Entra ID, you will see that the tokens contain the claims that represent the <U>Groups</U>, <U>RoleCollections</U>, and <U>User</U> Identifier info.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-08 at 6.02.17 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/93038iDF074F57326C609D/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-08 at 6.02.17 PM.png" alt="Screenshot 2024-04-08 at 6.02.17 PM.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-08 at 6.01.10 PM.png" style="width: 982px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/93039i00D82A733F67F3CD/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-08 at 6.01.10 PM.png" alt="Screenshot 2024-04-08 at 6.01.10 PM.png" /></span></P><P>12. Simply go ahead and '<U>Use Token</U>' to load the token to make your request.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 11.18.01 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92477i0BF06E608D43D2AA/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 11.18.01 AM.png" alt="Screenshot 2024-04-07 at 11.18.01 AM.png" /></span></P><P>13. Using the refresh_token -&gt; Notice that the token will expire after a set duration (based on the 'expiry' setting). As you can see in the screenshot below, Postman detects that the available token is expired. It gives an option to '<U>Refresh</U>' the token. Click on this button.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 12.58.21 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92484i6CD290951A002C25/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 12.58.21 PM.png" alt="Screenshot 2024-04-07 at 12.58.21 PM.png" /></span></P><P>14. Make a note in the Console tab that the client POSTs to the token endpoint with the available refresh_token and the refresh_token grant_type to get a fresh access token.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-07 at 12.59.15 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92485i844B14E9BCCE1FBB/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-07 at 12.59.15 PM.png" alt="Screenshot 2024-04-07 at 12.59.15 PM.png" /></span></P><P>15. In the next screenshots, let us perform the same set of steps in a browser.&nbsp;We will need to frame the URL to the <FONT face="terminal,monaco" color="#993366">/oauth/authorize</FONT> endpoint. The easiest way to do so would be to copy the URL from the Postman Console we referred to before. The URL is in the format :</P><PRE><A target="_blank" rel="noopener">https://&lt;tenant-id&gt;&gt;/authentiation.&lt;dc&gt;.hana.ondemand.com/oauth/authorize<SPAN>?<BR />response_type=code&amp;client_id=&lt;url-encoded-client-id&gt;&amp;redirect_uri=&lt;url-encoded_redirect_uri&gt;</SPAN></A></PRE><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-08 at 8.58.56 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92933i2E3BE633C8DBD648/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-08 at 8.58.56 AM.png" alt="Screenshot 2024-04-08 at 8.58.56 AM.png" /></span></P><P>16. Invoke the URL in a browser.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-08 at 9.24.05 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92934iCE3000E772A66A02/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-08 at 9.24.05 AM.png" alt="Screenshot 2024-04-08 at 9.24.05 AM.png" /></span></P><P>17. After the 'login' and 'authenticate' procedures, you will see that the browser is redirected to the redirect_uri location. You can copy the '<FONT face="terminal,monaco" color="#993366">code</FONT>' parameter from the URL.&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-08 at 8.59.57 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92935i642C2B58390DCE85/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-08 at 8.59.57 AM.png" alt="Screenshot 2024-04-08 at 8.59.57 AM.png" /></span></P><P>18. Go back to Postman and POST the Access Token endpoint with the <FONT face="terminal,monaco" color="#993366">grant_type</FONT> set to <FONT face="terminal,monaco" color="#993366">authorization_code</FONT> and the copied <FONT face="terminal,monaco" color="#993366">code</FONT> and the <FONT face="terminal,monaco" color="#993366">redirect_uri</FONT>. The server will respond with the <FONT face="terminal,monaco" color="#993366">access_token</FONT> with the same set of attributes populated as demonstrated in Step 11.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-08 at 9.03.29 AM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92936iBAA309680685FF77/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-08 at 9.03.29 AM.png" alt="Screenshot 2024-04-08 at 9.03.29 AM.png" /></span></P><H3 id="toc-hId--2099599829">&nbsp;</H3><H3 id="toc-hId-1998853962">Step 4: Integration Flow Reciever side propagation</H3><P>Now that we have an <FONT face="terminal,monaco" color="#993366">access_token</FONT> that can be presented to the Cloud Integration runtime (to a 'Sender Adapter'), let us put together a simple IFlow that can demonstrate the fact that the user's identity from the external identity provider can be propagated to 3 backend systems - <U>a)</U> S/4HANA Onpremse, <U>b)</U> SuccessFactors and <U>c)</U> S/4HANA Cloud via <U>Principal Propagation</U> and <U>OAuth2SAMLBearer</U> mechanisms respectively.</P><P>Here is a summary of the steps we intend to achieve:</P><TABLE border="1" width="100%"><TBODY><TR><TD width="50%"><STRONG>Objective</STRONG></TD><TD width="50%"><STRONG>Steps</STRONG></TD></TR><TR><TD width="50%">Create a sample IFlow that demonstrates the user propagation sequence to 3 different types of backend systems.</TD><TD width="50%">1-2</TD></TR><TR><TD width="50%">Invoke S4HANA Cloud backend&nbsp;</TD><TD width="50%">3 - 7</TD></TR><TR><TD>Invoke SAP SuccessFactors backend</TD><TD>8 - 13</TD></TR><TR><TD>Invoke SAP S/4HANA Onpremise backend</TD><TD>14 - 17</TD></TR></TBODY></TABLE><P>1. Let's start by putting together a simple IFlow to illustrate the user propagation flow. Since we are planning to invoke with 3 backends, the quickest way to demonstrate this would be to create a <U>Router</U> that has 3 branches. Each with a 'Request-Reply' step for the backend type, S/4HANA Cloud, SuccessFactors, and S/4HANA OnPremise respectively.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.04.01 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94321iB1506DA98BBAAA08/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.04.01 PM.png" alt="Screenshot 2024-04-09 at 5.04.01 PM.png" /></span></P><P>2. The logic we will follow is that the client passes a value in a custom header named 'target' that shall determine which of the routes is to be invoked.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.11.04 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94329iDAD95FEA401ADF4F/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.11.04 PM.png" alt="Screenshot 2024-04-09 at 5.11.04 PM.png" /></span></P><P>3. In the property sheet of the HTTP Receiver for S/4HANA Cloud backend, notice that we've used a credential named '<FONT face="terminal,monaco" color="#993366">s4hanaCloudCredentials</FONT>' with the OAuth2 SAML Bearer Assertion type.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.04.51 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94322i510E3E684E9F63B9/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.04.51 PM.png" alt="Screenshot 2024-04-09 at 5.04.51 PM.png" /></span></P><P>4. I will not get into the details behind how the attributes of this Security Material have been formulated. Refer to parts of&nbsp;<A href="https://community.sap.com/t5/technology-blogs-by-sap/how-to-get-principal-propagation-from-cloud-foundry-to-s-4hana-cloud-with/ba-p/13534051" target="_self">this</A> blog post for details. The points worth mentioning here are that <U>a)</U> we are using the target system type <U>SAP BTP (CF)</U> and<U> b)</U> the '<FONT face="terminal,monaco" color="#993366">userIdSource'</FONT>&nbsp;attribute is annotated for '<FONT face="terminal,monaco" color="#993366">email</FONT>' &amp; nameIdFormat is set to '<FONT face="terminal,monaco" color="#993366">urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</FONT>', thereby implying that the user identifier from our original JWT token negotiated with the corporate identity provider will serve as the user principal to be propagated.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.08.29 PM.png" style="width: 833px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94324iB398FD91A28BDD12/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.08.29 PM.png" alt="Screenshot 2024-04-09 at 5.08.29 PM.png" /></span></P><P>5. Let us make a call to the IFlow URL with the access token set from step 8 described in the above section. Note that we've set the 'target' header attribute to 's4hanacloud'&nbsp; so that the call gets executed in the first route. We get an HTTP 200 OK and the service document as the response and there you have it! We were able to successfully propagate the user from an external identity provider and execute a call in an S/4HANA backend with the user's context.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.11.42 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94328i421B86AB9618EB8D/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.11.42 PM.png" alt="Screenshot 2024-04-09 at 5.11.42 PM.png" /></span></P><P>6. How do I prove my point that the user was indeed propagated? The next two screenshots do so. Note that on the S/4HANA side, I have a 'Business User' that bears my (that is propagated from Okta) emailID. Also, note that the HTTP Call is executed with this user context and NOT with a Communication User (technical user) attached to the Communication Arrangement.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 4.24.48 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94326i27A22AD5685783C2/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 4.24.48 PM.png" alt="Screenshot 2024-04-09 at 4.24.48 PM.png" /></span></P><P>7. Further to prove my point, I execute step no. 5, this time by presenting my *@outlook.com user (that comes from Entra ID), you see that the call fails and the error description calls out that the backend was not able to resolve the presented *.outlook.com user.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.13.21 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94327i890B800F01F00C1B/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.13.21 PM.png" alt="Screenshot 2024-04-09 at 5.13.21 PM.png" /></span></P><P>8. Let us now look at the 2nd route, the one that invokes a SuccessFactors URL. We extend the same 'OAuthSAMLBearer Assertion' type with a credential named 'SFSFUserPrincipal'. On the processing tab, you will see that I'm invoking a GET Query on the JobProfile resource.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.06.05 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94332iB3049CBDC9B0A638/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.06.05 PM.png" alt="Screenshot 2024-04-09 at 5.06.05 PM.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-10 at 8.36.23 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94884i647EB0D62F0D3B36/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-10 at 8.36.23 PM.png" alt="Screenshot 2024-04-10 at 8.36.23 PM.png" /></span></P><P>9. In the details of the Security Material, note that we've set the attributes per SuccessFactors <A href="https://help.sap.com/docs/SAP_SUCCESSFACTORS_EMPLOYEE_CENTRAL/736e8ee2ac8943c7b6278039a7924e97/3a77fab602834ca686824555f7560d70.html?version=2205" target="_blank" rel="noopener noreferrer">documentation</A>. The User ID is set for principal propagation. Like before, we've used the same <FONT face="terminal,monaco" color="#993366">nameIdFormat</FONT> as set in step 4 above, and don't forget to include the <FONT face="terminal,monaco" color="#993366">apiKey</FONT> attribute as well.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.09.01 PM.png" style="width: 966px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94333iE5CE169F04974F33/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.09.01 PM.png" alt="Screenshot 2024-04-09 at 5.09.01 PM.png" /></span></P><P>10. Let us now invoke the IFlow, this time around with the header 'target' set to 'sfsf'. I get back a response from SuccessFactors with the JobProfile details.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.16.44 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94334i265F9EF4FBB1193A/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.16.44 PM.png" alt="Screenshot 2024-04-09 at 5.16.44 PM.png" /></span></P><P>11. Again, <EM>how do we prove that the call indeed was made in the signed-in user's context</EM>? There are many ways to establish this. A simple way I followed was to put a 'proxy' layer like API Management before the call hits the SuccessFactors backend and print out the '<U>Bearer token</U>' from the '<U>Authorization</U>' header.&nbsp; Upon Base64 decoding the token, you will see that the token bears a '<U>sfPrinciple</U>' attribute with the employee ID identifier.&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 2.54.16 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94335i5FCCE4AFBD05E781/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 2.54.16 PM.png" alt="Screenshot 2024-04-09 at 2.54.16 PM.png" /></span></P><P>12. Look up the employee profile of the user in question in your SuccessFactors tenant and you can verify the matching employee ID and the corresponding email address.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 2.53.41 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94336i749BE4BD06089628/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 2.53.41 PM.png" alt="Screenshot 2024-04-09 at 2.53.41 PM.png" /></span></P><P>13. Negative testing -&gt; If I perform the call again, this time by signing in with the email address from Entra ID you should see a 401 unauthorized exception stating that the propagated user wasn't resolved.&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.15.20 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94337iC1819ED14B8CBFF6/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.15.20 PM.png" alt="Screenshot 2024-04-09 at 5.15.20 PM.png" /></span></P><P>14. Finally, we are down to the last segment of our testing. A connection to S/4HANA On-premise. I've configured an SAP Cloud Connector and an X.509 certificate signing procedure (that is beyond the scope of this demonstration) and have dialed 'Principal Propagation' for the authentication type.&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.06.26 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94413i1D03B76E1099D38B/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.06.26 PM.png" alt="Screenshot 2024-04-09 at 5.06.26 PM.png" /></span></P><P>15. Invoking the client this time around with the 'target' header set to 's4hanaonpremise'. I get back a response from the server with my service document for the invoked GWSAMPLE_BASIC OData service.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-10 at 9.42.33 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94889i5506CCA84879D9A5/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-10 at 9.42.33 PM.png" alt="Screenshot 2024-04-10 at 9.42.33 PM.png" /></span></P><P>16. As a quick verification step, let us go to the 'Monitor' section in the Cloud Connector and within the 'Most Recent Requests' tab, you can see a record for the 'User' that was propagated.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 4.54.26 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94414i8899BAAC3848E6E0/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 4.54.26 PM.png" alt="Screenshot 2024-04-09 at 4.54.26 PM.png" /></span></P><P>17. Open the LJSTrace log file and you can hunt down a log entry that corresponds to the user subject that was propagated via the short-lived x.509 certificate.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-09 at 5.02.03 PM.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94415iC16607E26C47C404/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-04-09 at 5.02.03 PM.png" alt="Screenshot 2024-04-09 at 5.02.03 PM.png" /></span></P><P><EM>Phew!</EM></P><H2 id="toc-hId-2095743464">Summary:</H2><P>It is beyond doubt that '<FONT face="terminal,monaco" color="#993366">client credentials</FONT>' and '<FONT face="terminal,monaco" color="#993366">x.509 certificate</FONT>' are the two most prominent and widely popular ways to authenticate to an Integration Flow / API artifact in SAP Integration Suite, but should you have a requirement to authenticate and authorize with the client user's identity from a corporate Identity Provider, OpenID Connect support from SAP Cloud Identity Service along with the <FONT face="terminal,monaco" color="#993366">Authorization Code</FONT> grant type in SAP Integration Suite provide an excellent and out-of-box approach to get your job done.</P><P>Cheers, and more power to the&nbsp; <a href="https://community.sap.com/t5/c-khhcw49343/SAP+Integration+Suite/pd-p/73554900100800003241" class="lia-product-mention" data-product="23-1">SAP Integration Suite</a>&nbsp;&nbsp;Community!</P> 2024-04-11T06:53:39.270000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-the-xml-digital-signature-standard/ba-p/13668160 SAP Cloud Integration: Understanding the XML Digital Signature Standard 2024-04-15T10:23:50.369000+02:00 CarlosRoggan https://community.sap.com/t5/user/viewprofilepage/user-id/5495 <P data-unlink="true"><SPAN><STRONG>SAP Cloud Integration</STRONG> offer</SPAN>s iFlow <SPAN>step</SPAN>s<SPAN> for </SPAN>signing and verifying <SPAN>XML content according to the "XML </SPAN>Signature<SPAN>" standard.&nbsp;Th</SPAN>is<SPAN> standard provides some benefits and flexibility specifically for xml content.<BR /></SPAN><SPAN>Th</SPAN>e present<SPAN> article is intended to introduce into the "XML </SPAN>Signature<SPAN>" standard, as preparation for hands-on</SPAN> tutorial in next blog post<SPAN>.<BR /></SPAN><SPAN>I'm trying to explain everything simple, with my simple understanding and my simple words - this is not a professional article.<BR /></SPAN><SPAN>In this blog post, I will try to answer many questions and show examples.<BR /></SPAN>The following concepts are explained:<BR /><SPAN>Hash/Digest</SPAN>,&nbsp;<SPAN>Digital Signature&nbsp;</SPAN>,&nbsp;XML Signature.<BR /><SPAN>The <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-manually-sign-verify-xml-payload-based-on-xml-signature/ba-p/13671049" target="_blank">next blog post</A> shows how we can </SPAN>sign<SPAN>/ </SPAN>verify <SPAN>XML payloads, according to the XML&nbsp;</SPAN>Signature<SPAN> spec, manually in a Groovy script.</SPAN></P><H2 id="toc-hId-991777973">Overview</H2><OL><LI>History</LI><LI>Basics: Digest, Digital Signature</LI><LI>Specifics: XML Signature</LI><LI>Canonicalization</LI><LI>General Info</LI></OL><H2 id="toc-hId-795264468">1. History</H2><P>How I imagine that everything started:<BR />Timmy from Texas wanted to share some secret info with his friend Taku in Tokyo.<BR />So he encrypted a message and sent it to Taku.<BR />Taku was unable to decrypt and read the message.<BR />So Timmy travelled to Tokyo to enjoy some food and to explain the way how he encrypts and packages his messages.<BR />Afterwards, Taku in Tokyo was able to decrypt and read all messages (even before breakfast).<BR />Some time later, same situation happened with his friend Toto in Togo.<BR />Although the food is said to be great, Timmy decided not to travel, but to invite his friends for a conference at home.<BR />They had international food, late-night discussions and at the end, they agreed on a common way of sending secure messages.<BR />As a consequence, everybody in the world can send secure messages and the recipients can understand the message, as long as they follow that agreement.<BR /><BR /><FONT color="#999999">Does that make sense?</FONT><BR />Really makes sense, especially the section about the international food (which didn’t make it into the specification).<BR /><BR /><FONT color="#999999">What do we learn from this story?</FONT><BR />People communicating with each other need to agree on some basic principles:<BR />- how encryption is done, which steps in which order<BR />- what exactly is encrypted<BR />- which algorithms are used<BR />- certificate information&nbsp;<BR />- where is that information stored</P><P><FONT size="3">This intro was copied from my&nbsp;<A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-pkcs-7-cms-standard/ba-p/13560268" target="_blank">cms-post</A>.&nbsp; &nbsp; &nbsp;</FONT></P><H2 id="toc-hId-598750963"><STRONG>2. </STRONG><STRONG>Introduction</STRONG><STRONG> to Digital Signatures</STRONG></H2><P>We start from the very beginning to explain the concepts of signing.<BR />Experienced readers can skip this section.<BR /><FONT color="#999999">Can we skip the blog post?</FONT><BR />Experienced readers can skip the whole blog post.</P><P>Example:<BR />You want to buy something, e.g. a cat&nbsp;<span class="lia-unicode-emoji" title=":cat:">🐈</span><BR />You take a piece of paper, write a contract which covers the product and the price, go to post office and send it to the dealer.<BR />The dealer calls you and says that your request is not valid.<BR /><FONT color="#999999">Ohhh- What has happened?</FONT><BR />The dealer doesn’t trust a contract that is not signed.</P><P>OK.<BR />Try again: this time you sign the contract with your signature.&nbsp;<span class="lia-unicode-emoji" title=":writing_hand:">✍️</span><BR />You receive a package…<BR /><FONT color="#999999">Exciting…<BR /></FONT>… but it contains&nbsp;a hungry crocodile&nbsp;instead of a fluffy cat, plus the price is much higher.<BR /><FONT color="#999999">OMG - What has happened?&nbsp;&nbsp;<span class="lia-unicode-emoji" title=":crocodile:">🐊</span></FONT><BR />Somebody modified the contract replacing animal and price.</P><P>OK.<BR />Try again: this time you sign the contract, put it in an envelope which you close with a seal.&nbsp;<span class="lia-unicode-emoji" title=":envelope:">✉️</span><BR />Afterwards, you finally receive your fluffy cat (a bit fat, though).&nbsp;<span class="lia-unicode-emoji" title=":grinning_cat_face:">😺</span><BR /><FONT color="#999999">Cool </FONT><span class="lia-unicode-emoji" title=":thumbs_up:">👍</span><FONT color="#999999">What has happened?</FONT><BR />The dealer trusts the signature and moreover, the contract couldn’t be altered, as it was secured.</P><P><FONT color="#999999">What do we learn?</FONT><BR />We need two mechanisms to ensure:<BR />&nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>&nbsp;The content is not modified&nbsp;<span class="lia-unicode-emoji" title=":right_arrow:">➡️</span> “integrity”<BR />&nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span> The content is original&nbsp;<span class="lia-unicode-emoji" title=":right_arrow:">➡️</span> “authenticity”.</P><P><FONT color="#999999">Nice. Ehm - why do we have to learn that?</FONT><BR />Now let’s transfer this learning to the digital world.<BR /><BR /><FONT color="#999999">How do we ensure integrity in a digital world?</FONT><BR />Let's see a common example where integrity is required:<BR />Downloading software from a web page.<BR />Usually, in addition to the zip file, a checksum is published in the website.<BR />This allows us to verify that the zip is not modified.<BR />So we’re sure that there’s nothing malicious in it (allowing a hacker to e.g. steal our private cat photos)<BR /><BR /><FONT color="#999999">What is a checksum?</FONT><BR />In general, it is the same as: “hash” or “hash value” or “hash code” or “digest” or “fingerprint”.<BR /><FONT color="#999999">Ehhmmm - what?<span class="lia-unicode-emoji" title=":confused_face:">😕</span></FONT><BR />It is a code, a silly combination of characters and numbers.<BR /><FONT color="#999999">Can we have an example?</FONT><BR />This is a hash code:<BR />f7a5f85f2b80792a7b4650f009b130dd1b955d855c99ef64d7b98e5f103f3709<BR />And this is a digest:<BR />f7a5f85f2b80792a7b4650f009b130dd1b955d855c99ef64d7b98e5f103f3709<BR /><FONT color="#999999">It is the same...&nbsp;<span class="lia-unicode-emoji" title=":thinking_face:">🤔</span></FONT><BR />Exactly.<BR /><BR /><FONT color="#999999">How does it work?</FONT><BR />To produce a hash code, we need to use a&nbsp;<STRONG>hash function</STRONG>, or better a&nbsp;<STRONG>cryptographic hash function</STRONG>&nbsp;(CHF).<BR /><FONT color="#999999">What’s the difference?</FONT><BR />Generally speaking, CHF is more secure.<BR />Differences are fine-granular and security related.<BR /><BR /><FONT color="#999999">What is a hash function?</FONT><BR />Based on an algorithm, the hash function creates a hash code from any input data (e.g. text, image, etc).<BR />Important properties:<BR />- The input can be of any size, where the digest will always have a fix size.<BR />- It is not possible to guess the original text from the digest (one-way).<BR />- Any small change in the input file will produce different digest (hash collision).<BR />- As such, the digest (hash) proves that the original input is not changed (-&gt; integrity).<BR />BTW, no key or secret or password is required here<BR /><BR /><FONT color="#999999">Any examples for hash functions?</FONT><BR />SHA-256 (and more), MD5 (and more), RIPEMD, BLAKE (etc), GOST</P><P><FONT color="#999999">What are the differences?</FONT><BR />Some are more safe than others</P><P><FONT color="#999999">What does SHA-256 mean?</FONT><BR />It stands for "Secure Hash Algorithm" and the hash value has a size of 256 bits.<BR />See below for more info.</P><P data-unlink="true"><FONT color="#999999">Now a diagram would be helpful...</FONT><BR />OK OK</P><P data-unlink="true"><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="diagram_hashFunction.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95593i64AA8B740D587944/image-size/medium?v=v2&amp;px=400" role="button" title="diagram_hashFunction.jpg" alt="diagram_hashFunction.jpg" /></span></P><P><FONT color="#999999">&nbsp;How is a cat function used?</FONT><BR />You mean hash function.<BR />We have an important document that should be signed.<BR />We create a hash value with a (cryptographic) hash function (e.g. SHA-256).<BR />We send both to the receiver.<BR />The receiver views the document and wonders if it might have been altered.<BR />He creates his own hash value with same hash algorithm (SHA-256).<BR />He compares his own hash value with our value which we had sent to him.<BR />As we know, even the slightest change in the document results in a different digest.<BR />If both hashes are equal, he can be sure that the content was not altered.<BR /><BR /><FONT color="#999999">Can we look at a dia…</FONT><BR />OK OK</P><P data-unlink="true"><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="diagram_hashFunction2.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95595iC47984E5B5E2ED0D/image-size/medium?v=v2&amp;px=400" role="button" title="diagram_hashFunction2.jpg" alt="diagram_hashFunction2.jpg" /></span></P><P>&nbsp;</P><P><FONT color="#999999">Nice. Can we try it out?</FONT><BR />Yes. See&nbsp;next blog post<BR /><BR /><FONT color="#999999">So the Signer in CPI is a hash function?</FONT><BR />No.<BR /><FONT color="#999999">What is it? A fat cat?</FONT><BR />No, we have to go one more preparation step further.<BR />Simply using hash is not secure enough.<BR /><FONT color="#999999">Super, I’ve wasted my time ;-(</FONT><BR />Wait.<BR />A malicious hacker who intercepts the e.g. eMail can alter the document, create his own new hash and forward the eMail. Nobody would notice that the document was changed.<BR />So the weak point is: we don’t have authenticity.<BR />To overcome this weakness:<BR />Use&nbsp;<STRONG>digital signature</STRONG>.<BR /><BR /><FONT color="#999999">What is a digital signature?</FONT><BR />In brief: create a hash value and then encrypt it.<BR /><FONT color="#999999">In long?</FONT><BR />Similar as before, we create a hash value to ensure integrity.<BR />Now we want to protect the hash.<BR />To avoid hacker attacks, we encrypt the hash with a private key.<BR />(As prerequisite, we need a key pair.)<BR />Then send the document along with&nbsp; the encrypted hash to the receiver.<BR />(The receiver needs our public key. The public key is public, so there’s no problem with it.)<BR />The receiver can decrypt the encrypted hash with the public key.<BR />Then he can proceed as explained before:<BR />create his own hash and compare..<BR /><FONT color="#999999">Why is this more secure?</FONT><BR />It is impossible for a hacker to decrypt the hash, to alter the doc and create new hash.<BR />If the hacker alters the doc, creates a new hash and encrypts it himself (with his own private key), then the receiver won’t be able to decrypt with public key.<BR />This would mean that the doc was hacked.<BR /><BR /><FONT color="#999999">Oh, that sounds complex….</FONT><BR />OKOK, here comes the visualization:</P><P>&nbsp;</P><P data-unlink="true"><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="diagram_hashFunction3.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95597i93023A23964168D7/image-size/medium?v=v2&amp;px=400" role="button" title="diagram_hashFunction3.jpg" alt="diagram_hashFunction3.jpg" /></span></P><P>&nbsp;<FONT color="#999999"><SPAN>What about the keys?</SPAN></FONT></P><P>In asymmetric encryption, we always talk about key pairs.<BR />Private and public key are always generated together, they mathematically belong together.<BR />The public key is public and can be published in the internet.<BR />It is not possible to guess the private key from it<BR />To generate a key pair, we use tools, like openSSL, or CPI, etc.<BR /><FONT color="#999999">What about the practical example?</FONT><BR />&lt;Sigh&gt;. See&nbsp;next blog post<BR /><BR /><FONT color="#999999">So the Signer in CPI is a digital signature?</FONT><BR />Almost.<BR /><FONT color="#999999">Why?</FONT><BR />We have to go one last education step further:<BR />The signer in CPI is embedded into the&nbsp;<STRONG>XML Signature</STRONG>&nbsp;standard.<BR />Now comes the next question,,,</P><P>&nbsp;</P><P data-unlink="true"><FONT color="#999999">What is XML Signature Standard??</FONT><BR />It is not only a normal signature, it is more than that.<BR />We’re signing a message and sending it out to a receiver.<BR />To enable the receiver to decrypt/verify it, we need to add additional information/metadata to the message (e.g. algorithm info).<BR />All must be nicely structured, as the receiver needs to know where to find everything he needs to decrypt and verify.<BR /><BR /><FONT color="#999999">Is there anything else?</FONT><BR />Yes...<BR /><FONT color="#999999">OMG - don't want to know it...<BR /></FONT>The difference between XML Signature Standard and CMS (PKCS7) Standard:<BR />The CMS Standard can be applied to sign any content, including xml, no problem.<BR />However, the XML content itself is structured – so why not use the structure to add the signature-metadata-structure to it?<BR />Furthermore, there’s a big advantage in having structured XML content:<BR />Instead of always signing the content as a whole, we can choose to sign only an XML subtree.</P><P><FONT color="#999999">Why is this an advantage?</FONT><BR />The message content might contain a section containing info that does change, but doesn’t affect the integrity.<BR />For example: a timestamp<BR />We don’t want a changed timestamp to cause the signature-verification to fail.</P><P><FONT color="#999999">Is there a disadvantage?<BR /></FONT>Yes<BR /><FONT color="#999999">I don’t want to know it (I shouldn't have asked).<BR /></FONT>Sorry: we have to go through it.<BR /><FONT color="#999999">Later?<span class="lia-unicode-emoji" title=":grinning_cat_face_with_smiling_eyes:">😸</span><BR /></FONT>Agreed, we talk later..</P><P>Most of this intro was copied from my <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-pkcs-7-cms-signer/ba-p/13555514" target="_blank">CMS Signer blog post</A>.&nbsp;</P><H2 id="toc-hId-402237458"><SPAN>3. XML Signature</SPAN></H2><P>Up to now, we know that<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>we have an xml content<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>we create hash and encryption<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>we have to store the hash and the metadata somehow in the xml.</P><P>It is time to look at the "XML Signature" standard itself.<BR />The most important info that is defined by the standard:</P><OL><LI>What is signed?</LI><LI>How it is signed?</LI><LI>Where is it stored?</LI></OL><P>In addition:</P><OL><LI>the tedious disadvantage of xml</LI></OL><P>So let’s get to know it.<BR />Our examples are based on this simple sample xml service payload:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="xml_sample.jpg" style="width: 457px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95600iD583965BBC22BA3F/image-size/large?v=v2&amp;px=999" role="button" title="xml_sample.jpg" alt="xml_sample.jpg" /></span></P><P><SPAN>3.1. Signing Modes</SPAN></P><P>&nbsp;</P><P>As mentioned, xml allows for flexibility:<BR />A signature can be enveloped or enveloping.</P><P>Sounds confusing. What does it mean?<BR />Personally, I translate it as follows:</P><OL><LI>Enveloping = embracing = parent<BR />Parent embraces a child.<BR />If a signature is enveloping, this means:<BR />The signature is a parent node of the whole content.<BR />With other words: our message is a child node of a new signature-root node.</LI></OL><P data-unlink="true"><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="intro_enveloping.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95603iB61DEC1C27EF2673/image-size/medium?v=v2&amp;px=400" role="button" title="intro_enveloping.jpg" alt="intro_enveloping.jpg" /></span></P><OL><LI>Enveloped = embraced = child<BR />The signature is a child node of the message content.<BR />The xml content is enriched with an additional &lt;Signature&gt;-section:<BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="intro_enveloped.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95606i4227ADFBE518D33C/image-size/medium?v=v2&amp;px=400" role="button" title="intro_enveloped.jpg" alt="intro_enveloped.jpg" /></span><BR />And finally, there’s an additional variant:</LI><LI>Detached<BR />In this case, the signature is a standalone xml tree which lives somewhere next to the xml content.<BR />Like so:<BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="intro_detached.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95608i3EDCE8E5FD82EDFE/image-size/medium?v=v2&amp;px=400" role="button" title="intro_detached.jpg" alt="intro_detached.jpg" /></span></LI></OL><P data-unlink="true">Understood?<BR /><FONT color="#999999">ehhmm....<BR /></FONT>OK, let's repeat with more detailed pictures<BR /><FONT color="#999999">Can we play a game?</FONT><BR />Sigh&nbsp;<span class="lia-unicode-emoji" title=":face_with_rolling_eyes:">🙄</span><BR />What kind of signature mode is applied below?</P><P data-unlink="true"><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="intro_enveloped2.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95613i1767F1AD47EE34EA/image-size/medium?v=v2&amp;px=400" role="button" title="intro_enveloped2.jpg" alt="intro_enveloped2.jpg" /></span></P><P><FONT color="#999999">Umm - enveloped?</FONT><BR />Great.<BR />And here?</P><P data-unlink="true"><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="intro_enveloping2.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95614iB3B7A39475C9B595/image-size/medium?v=v2&amp;px=400" role="button" title="intro_enveloping2.jpg" alt="intro_enveloping2.jpg" /></span></P><P><FONT color="#999999">Umm - enveloping?</FONT><BR />Perfect.<BR /><FONT color="#999999">Is there a price?</FONT><BR />What do you want?<BR /><FONT color="#999999">Ummm - a croco...?</FONT></P><H3 id="toc-hId-334806672"><SPAN>3.2. Structure</SPAN></H3><P>The examples above have been very simplified, let’s have a closer look now.<BR />When calculating the XML Signature of an XML content, then we get a result which itself is an XML tree.<BR />The root element of this tree is a <FONT face="courier new,courier">&lt;Signature&gt;</FONT>.<BR />Roughly speaking, this tree has the following 3 main sections:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;Signature&gt; &lt;SignedInfo&gt; &lt;SignatureValue&gt; &lt;KeyInfo&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P><U>Explanation of &lt;Signature&gt; section:</U></P><P><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;SignedInfo&gt;</FONT><BR />This top-element contains the information and metadata that are considered during signing.<BR />Personally, I don’t like the name, it is somehow confusing.<BR />I would prefer to call it “Info about Signing”</P><P><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;SignatureValue&gt;</FONT><BR />The overall result of the signing process is contained here.<BR />Note that the result has to be encoded with Base64, before it can be inserted in an XML payload.</P><P><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;KeyInfo&gt;<BR /></FONT>This element can contain the public key, which is required to verify the signature.<BR />Instead of the public key itself, the certificate (or parts of it) can be included.<BR />This element is optional. The required public key can be already known to the receiver.</P><P>More details:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="intro_sigSubtree.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95618i748A7CB1E473FCBE/image-size/medium?v=v2&amp;px=400" role="button" title="intro_sigSubtree.jpg" alt="intro_sigSubtree.jpg" /></span></P><P><U>Explanation of &lt;SignedInfo&gt; section:</U></P><P data-unlink="true"><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;CanonicalizationMethod&gt;</FONT><BR />This element contains the info about which canonicalization method is applied to the content, before signing.<BR />See chapter below for more info.<BR />Example:<BR /><FONT face="courier new,courier"><FONT color="#0000FF">http://www.w3.org/2006/12/xml-c14n11</FONT>&nbsp;</FONT></P><P><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;SignatureMethod&gt;</FONT><BR />The algorithms used to digest and encrypt, during signature creation.<BR />For instance, use a SHA algorithm with key length 256 to create the hash value, then use an RSA based private key to encrypt the hash.<BR />Example value:<BR /><EM><FONT face="courier new,courier" color="#0000FF"><A href="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" target="_blank" rel="noopener nofollow noreferrer">http://www.w3.org/2001/04/xmldsig-more#rsa-sha256</A></FONT>&nbsp;</EM></P><P><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;Reference&gt;<BR /></FONT>We have to store the information about what content is signed.<BR />As we know, it can be the whole content or just any xml-element somewhere in the tree, or even outside.<BR />As such, it is necessary to point to the xml-element that is signed.<BR />That’s done via the <FONT face="courier new,courier">&lt;Reference&gt;</FONT> tag which contains an URI attribute.<BR />So the <FONT face="courier new,courier">&lt;Reference&gt;</FONT> stands for the content to be signed.<BR />There can be multiple separate xml-sections specified by multiple <FONT face="courier new,courier">&lt;Reference&gt;</FONT> nodes.<BR />Furthermore, the <FONT face="courier new,courier">&lt;Reference&gt;</FONT> contains the information, how the content is treated.<BR />Such info is contained as <FONT face="courier new,courier">&lt;Transform&gt;</FONT> element</P><P><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;Transforms&gt;<BR /></FONT>There can be multiple transformations that are applied to the selected content, before signing.<BR />One prominent example is the canonicalization.</P><P><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;DigestMethod&gt;<BR /></FONT>This element is a child of the <FONT face="courier new,courier">&lt;Reference&gt;</FONT>.<BR />As such it is relevant only for the content which is specified by the <FONT face="courier new,courier">&lt;Reference&gt;</FONT>.<BR />Here we can see which hash algorithm is applied to the content.<BR />Example:<BR /><EM><FONT face="courier new,courier" color="#0000FF"><A href="http://www.w3.org/2001/04/xmlenc#sha256" target="_blank" rel="noopener nofollow noreferrer">http://www.w3.org/2001/04/xmlenc#sha256</A></FONT>&nbsp;</EM></P><P>Note that his URI points to the <FONT face="courier new,courier" color="#0000FF">xmlenc</FONT>&nbsp;("XML Encryption") standard which defines the usage of the SHA-256 algorithm. Same is valid here.</P><P>Note that in XML Signature, there are 2 separate hashing steps, that’s why we have 2 elements containing info about hash-algorithm.<BR />See below chapter for more explanation.</P><P><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;DigestValue&gt;<BR /></FONT>Again, this element is valid for the specific <FONT face="courier new,courier">&lt;Reference&gt;</FONT> only.<BR />The hash of the referenced content is calculated with algorithm mentioned above (SHA-256).<BR />The result is stored here.</P><P><FONT face="courier new,courier">&lt;<span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&gt;&lt;...&gt;<BR /></FONT>There are a few more elements, but let’s ignore them here.</P><P>Example for <FONT face="courier new,courier">&lt;Signature&gt;</FONT> structure:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="intro_sigSubtree_example.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95622i37FBA4BDCCEE4BAF/image-size/medium?v=v2&amp;px=400" role="button" title="intro_sigSubtree_example.jpg" alt="intro_sigSubtree_example.jpg" /></span></P><P>&nbsp;Example with values:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="intro_sigSubtree_example2.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95623i6DF5E82A89A192B3/image-size/medium?v=v2&amp;px=400" role="button" title="intro_sigSubtree_example2.jpg" alt="intro_sigSubtree_example2.jpg" /></span></P><H3 id="toc-hId-138293167"><SPAN>3.3. Process</SPAN></H3><P data-unlink="true"><SPAN>To better understand what is happening, we should have a look at what is actually done, when creating an xml signature - and when verifying it.</SPAN></P><H4 id="toc-hId-70862381"><U>3.3.1. Process of Signing</U></H4><P>We learned above:<BR />A digital signature means to create a hash and encrypt it.<BR /><FONT color="#999999">Um?</FONT><BR />No nooooooo...<BR />Unfortunately, the XML Signature Standard is not so simple.<BR />We’re not just creating a signature of some content.<BR />To make it secure, even the metadata and the hash need to be signed.<BR /><FONT color="#999999">Sigh ;-(</FONT><BR />OK. Let's...<BR /><FONT color="#999999">Yes, sign makes me sigh…..</FONT><BR />OK.<BR /><FONT color="#999999">And makes me sick….</FONT><BR />Let’s get a rough overview of the overall process.</P><P><U>1. The content:<BR /></U>These steps are done with the content, .e.g the message payload.</P><P>1.1. The content that should be signed is identified.<BR />Example:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="process1_content.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95627i94CB75B3BA34DC38/image-size/medium?v=v2&amp;px=400" role="button" title="process1_content.jpg" alt="process1_content.jpg" /></span></P><P>1.2. This content is canonicalized.<BR />1.3. The digest of the content is calculated.<BR />1.4. The digest is base64-encoded.</P><P><U>2. The &lt;SignedInfo&gt;<BR /></U>These steps are done with the &lt;SignedInfo&gt; element.</P><P>2.1. The &lt;SignedInfo&gt; element is constructed.<BR />2.2. The calculated digest (see 1.3.) is inserted in the subtree.<BR />2.3. The &lt;SignedInfo&gt; element is canonicalized.<BR />2.4. The signature of &lt;SignedInfo&gt; element is created.<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.4.1. The hash of &lt;SignedInfo&gt; is calculated<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.4.2. The hash is encrypted with private RSA key<BR />2.5. The signature is base64-encoded</P><P><U>3. The whole Document<BR /></U>Finally, the overall message payload is affected.</P><P>3.1. The final result, the whole &lt;Signature&gt; element is constructed.<BR />3.2. The signature (see 2.4.) is inserted<BR />3.3. The super-final result, the documents as a whole, is enriched with the &lt;Signature&gt; element.</P><P><U>Summary<BR /></U>The content is digested.<BR />The &lt;SignedInfo&gt; is digested and signed.<BR />In addition: beforehand the canonicalization – and afterwards the base64-encoding has to be applied.</P><P>The simplified result of an enveloped signature:&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="process1_result.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95634iAC8A4523AFDCAF29/image-size/medium?v=v2&amp;px=400" role="button" title="process1_result.jpg" alt="process1_result.jpg" /></span></P><P>&nbsp;</P><H4 id="toc-hId--125651124"><U>3.3.2. Process of Verification</U></H4><P>Let’s briefly repeat the process, this time from the verification perspective.</P><P><FONT color="#999999">Ehmm - what does verification mean?<BR /></FONT>Repeat:<BR /><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Verification of a digest:<BR />&nbsp; -&gt; compute a new hash<BR />&nbsp; &nbsp; &nbsp; -&gt; then compare it to the original hash.</P><P><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Verification of digital signature:<BR />Decrypt<BR />&nbsp; -&gt; Decrypt the signature with public key<BR />&nbsp; &nbsp; &nbsp;-&gt; compute a new hash<BR />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-&gt; then compare it to the original hash.</P><P><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Verification of an XML Signature:<BR />See below.&nbsp;</P><P><U>1. Verify the content-digest</U></P><P>Here, we're talking about the hash that was calculated of the original message payload (or part).</P><P>1.1. &nbsp;Identify the content (info found in <FONT face="courier new,courier">&lt;Reference&gt;</FONT>).<BR />1.2. Apply the canonicalization and other transforms (info found in <FONT face="courier new,courier">&lt;Reference&gt;</FONT>).<BR />1.3. Identify the algorithm for hashing (info found in <FONT face="courier new,courier">&lt;Reference&gt;/&lt;DigestMethod&gt;</FONT>).<BR />1.4. Calculate new digest.<BR />1.5. Identify the old digest from &lt;Reference&gt;/&lt;DigestValue&gt;.<BR />1.6. Compare both.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="process2_digest.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95646i1DB3BCF6AE61B041/image-size/medium?v=v2&amp;px=400" role="button" title="process2_digest.jpg" alt="process2_digest.jpg" /></span></P><P>&nbsp;</P><P><U>2. Verify the signature </U></P><P>Here we're talking about the <FONT face="courier new,courier">&lt;SignedInfo&gt;</FONT> element, which was signed.<BR />To verify a digital signature, a public key is required, which is either known or contained in the xml.</P><P>2.1. Identify the <FONT face="courier new,courier">&lt;SignedInfo&gt;</FONT> element.<BR />2.2. Identify the method for canonicalization (info at&nbsp;<FONT face="courier new,courier">&lt;SignedInfo&gt;/&lt;CanonicalizationMethod&gt;</FONT>)<BR />2.3. Canonicalized the <FONT face="courier new,courier">&lt;SignedInfo&gt;.<BR /></FONT>2.4. Fetch the public key, which is either known, or contained in <FONT face="courier new,courier">&lt;Signature&gt;/&lt;KeyInfo&gt;</FONT> element.<BR />2.5.&nbsp; Identify the algorithm (info in <FONT face="courier new,courier">&lt;SignatureMethod&gt;</FONT>)<BR />2.6. Perform the signature-verification</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="process2_sig.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95645i95837B4CDAA16D9A/image-size/medium?v=v2&amp;px=400" role="button" title="process2_sig.jpg" alt="process2_sig.jpg" /></span></P><H2 id="toc-hId--580330067">4. Canonicalization</H2><P>Finally, let's talk about that tedious topic, as I promised above.<BR /><FONT color="#999999">Can we do that later...?</FONT></P><H3 id="toc-hId--647760853"><SPAN>4.1. Intro</SPAN></H3><P>OK.<BR /><FONT color="#999999">What is canonicalization?</FONT><BR />We know that XML is used for storing structured data and for enriching it with metadata.<BR />Example:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;order&gt; &lt;customer trusted="yes" active="true"&gt;Joe&lt;/customer&gt; &lt;/order&gt; </code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>When reading the data from it, we don’t care about the way how it is formatted:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;order &gt; &lt;customer active="true" trusted = ’yes’&gt; Joe &lt;/customer&gt; &lt;/order &gt; </code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Both XML snippets are valid and have the <U>same</U> content - although they look different.<BR />We don’t care about<BR />&nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>silly spaces<BR />&nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>useless line feeds<BR />&nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>using inverted comma or quotation marks<BR />&nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>using different order of attributes<BR />Etc<BR /><FONT color="#999999">Sure - I don't care at all </FONT><span class="lia-unicode-emoji" title=":cat_face_with_tears_of_joy:">😹</span><BR />However……<BR />In case of cryptographic hashes, we know that changing one little cute byte does invalidate the content and causes the verification to fail.<BR />So just imagine that the xml payload goes through an iFlow……. It will be for sure re-formatted by any iFlow step.&nbsp;Normally, this doesn’t matter, because xml is anyways parsed by machines, so the format is irrelevant.<BR />But if some xml is used for signature, then the format matters.<BR /><FONT color="#999999">Really?</FONT><BR />Really really matters&nbsp;<span class="lia-unicode-emoji" title=":exclamation_mark:">❗</span></P><P><FONT color="#999999">How can it be solved?</FONT><BR />We must agree on a totally default standard format for xml.<BR />This must be agreed on – which results in another standard.<BR /><FONT color="#999999">OMG - how boring&nbsp;<span class="lia-unicode-emoji" title=":sleeping_face:">😴</span></FONT><BR />And here it is:<BR />The <A href="https://www.w3.org/TR/xml-c14n/" target="_blank" rel="noopener nofollow noreferrer">XML Canonicalization</A> standard.<BR />Applying canonicalization to both sample snippets above, would result in a third representation:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;order&gt; &lt;customer active="true" trusted="yes"&gt;Joe&lt;/customer&gt; &lt;/order&gt; </code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>We can see that the attributes have fix order, useless spaces have been removed, etc<BR /><FONT color="#999999">What does the spec say?</FONT><BR />Let’s have a look at the spec and copy a little <A href="https://www.w3.org/TR/xml-c14n2/#sec-Output-Rules" target="_blank" rel="noopener nofollow noreferrer">excerpt</A>:</P><P>&nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>&nbsp;The XML declaration and document type declaration are removed.<BR />&nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>&nbsp;Attribute value delimiters are set to quotation marks (double quotes).<BR />&nbsp; &nbsp;<span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span> Empty elements are converted to start-end tag pairs.<BR />etc</P><P><FONT color="#999999">Why do we need different canonicalization methods?</FONT><BR />Good question and I recommend the tutorial for visual understanding.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>There are small differences in the different versions of specs.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Also, we can choose if we want to keep comments or not.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>And one important difference is the exclusive canonicalization (specified <A href="https://www.w3.org/TR/xml-exc-c14n/" target="_blank" rel="noopener nofollow noreferrer">here</A>)</P><P><FONT color="#999999">Last question: c14n?</FONT><BR />The word canonicalization is so long and hard to type and pronounce… people like to use c14n as abbreviation.<BR />The number 14 stands for the number of characters between c and n.<BR /><FONT color="#999999">Haha&nbsp;</FONT></P><H3 id="toc-hId--919505727"><SPAN>4.2. Optional: C14N Tutorial</SPAN></H3><P>You imagine how much I enjoyed typing C14N instead of Canoni….<BR />Let’s have a look at a few examples to see how c14n works.<BR />I’ve prepared a little code sample which uses the <A href="https://santuario.apache.org/index.html" target="_blank" rel="noopener nofollow noreferrer">Apache Santuario</A> library for c14n.<BR />The full code can be found in the Appendix.</P><P><U>xample 1: Simplest xml with Comment</U></P><P>Our first sample XML:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;!-- my comment --&gt; &lt;parent &gt; &lt;child batt='yes' att='no' /&gt; &lt;/parent &gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P data-unlink="true">We apply this c14 method: <FONT face="courier new,courier" color="#0000FF">http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments</FONT>&nbsp;</P><P>We use this Java code:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>Canonicalizer canon = Canonicalizer.getInstance(c14nMethod); canon.canonicalize(xml.getBytes(), System.out, false); </code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>And the result:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;!-- my comment --&gt; &lt;parent&gt; &lt;child att="no" batt="yes"&gt; &lt;/child&gt; &lt;/parent&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>What we see:<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>The comment has been preserved<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>The blanks inside the &lt;parent&nbsp;&nbsp; &gt; tag have been removed<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>The attributes have been ordered (a comes before b)<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>The inverted commas have been adapted</P><P><U>Example 2: Simplest xml removing Comment</U></P><P>Now we use the same input, but apply the c14 algorithm which removes comments:<BR /><FONT face="courier new,courier" color="#0000FF"><A href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" target="_blank" rel="noopener nofollow noreferrer">http://www.w3.org/TR/2001/REC-xml-c14n-20010315</A></FONT>&nbsp;</P><P>The result is the same as above, but without the comment in the first line.</P><P><U>Example 3: Namespaces and subtree</U></P><P>An interesting aspect is the propagation of namespaces.<BR />This becomes relevant, when we create a signature of a subtree only.<BR />In this case, the child element inherits the namespaces declared at parent.</P><P>In the following examples we will apply the c14n on a child node only.<BR />The XML content has a root element with 3 child elements.<BR />The parent has 2 namespace declarations.<BR />The children use only 1 of the declared namespaces.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;parent xmlns:pans='/pauri' xmlns:chns='/churi'&gt; &lt;child chns:att='good'/&gt; &lt;friend pans:att='OK' chns:att='cool'/&gt; &lt;brother/&gt; &lt;/parent&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>We apply the c14n method on the element “child”<BR /><FONT face="courier new,courier" color="#0000FF"><A href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" target="_blank" rel="noopener nofollow noreferrer">http://www.w3.org/TR/2001/REC-xml-c14n-20010315</A>&nbsp;</FONT></P><P>The sample code uses DOM method for retrieving the desired child node.<BR />Note that in the context of XML Signature it is recommended to use xPath, not DOM.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>InputStream stream = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)); Document doc = XMLUtils.read(stream, true); Node myChild = (Node)doc.getElementsByTagName(element).item(0); Canonicalizer canon = Canonicalizer.getInstance(c14nMethod); canon.canonicalizeSubtree(myChild, System.out); </code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>The result:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;child xmlns:chns="/churi" xmlns:pans="/pauri" chns:att="good"&gt;&lt;/child&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>We can see that both namespace declarations have been propagated to the child by the canonicalizer.</P><P><U>Example 4: Exclusive Canonicalization</U></P><P>To understand what "exclusive" means, we run the same example, but applying the exclusive method:<BR /><FONT face="courier new,courier" color="#0000FF"><A href="http://www.w3.org/2001/10/xml-exc-c14n#" target="_blank" rel="noopener nofollow noreferrer">http://www.w3.org/2001/10/xml-exc-c14n#</A></FONT>&nbsp;</P><P>The result:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;child xmlns:chns="/churi" chns:att="good"&gt;&lt;/child&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>We can see that only the one required namespace declaration has been propagated.</P><P><U>Example 5: Exclusive Canonicalization 2</U></P><P>Now let's compare to the <FONT face="courier new,courier">&lt;friend&gt;</FONT> element which has 2 attributes using both namespaces.<BR />The result:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;friend xmlns:chns="/churi" xmlns:pans="/pauri" chns:att="cool" pans:att="OK"&gt;&lt;/friend&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>We can see that both declarations have been propagated from the parent.</P><P>BTW, we can also see that the declarations and attributes are nicely ordered.</P><P><U>Example 5: Exclusive Canonicalization 3</U></P><P>Last example: we apply c14n on a child node that doesn’t have any attributes, hence doesn’t use any namespace.<BR />As a result of applying the exclusive canonicalization method, we can see that none of the declarations has been propagated:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;brother&gt;&lt;/brother&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Next test would be:<BR />Use the normal&nbsp;c14n method, not exclusive.<BR />We would wee that&nbsp;<SPAN>all declarations are inherited. Without necessity.<BR />We skip it here, but it is contained in the Appendix.</SPAN></P><P>BTW, furthermore we can see that the shortcut for empty tags has been replaced:</P><P><FONT face="courier new,courier">&lt;brother/&gt;</FONT> is c14n'ed to&nbsp; &nbsp;<FONT face="courier new,courier">&lt;brother&gt;&lt;/brother&gt;</FONT></P><H2 id="toc-hId--822616225">5. Optional: Some General Info</H2><P>There are several different names for the same thing:<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span><EM>XML Signature</EM> is the official name, as used in the specification.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>It is also called &nbsp;<EM>XMLDSig</EM>, <EM>XML-DSig</EM>, <EM>XML-Sig</EM>.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Personally, I would like to add the names <EM>XML-Digi-Sigi</EM>&nbsp;and <EM>xml-disi</EM>&nbsp;to the list (but up to now, nobody has adapted).</P><P>The standard was developed by the World Wide Web Consortium (W3C) and published as a W3C Recommendation.<BR />The specification can be found at <A href="https://www.w3.org/TR/xmldsig-core/" target="_blank" rel="noopener nofollow noreferrer">https://www.w3.org/TR/xmldsig-core/</A></P><P>It has version 1.1 as of 2013, which is expressed in the internal link <A href="http://www.w3.org/TR/2013/REC-xmldsig-core1-20130411/" target="_blank" rel="noopener nofollow noreferrer">http://www.w3.org/TR/2013/REC-xmldsig-core1-20130411/</A></P><P>REC &nbsp;stands for recommendation, this is the mature result of the definition process.<BR />TR stands for Technical Report, this is a general hint towards the character of the standard+</P><P>The XML Signature is used in xml-based technologies like SAML, SOAP, WSSecurity.</P><H2 id="toc-hId--1019129730">Summary</H2><P>The XML Signature standard is used for creating a digital signature of xml content.<BR />The signature is represented by an xml-tree<BR />The standard defines</P><P><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>&nbsp;&nbsp;3 ways of signing xml content: enveloping, enveloped and detached.<BR />- The signature can be inserted as subtree somewhere in the xml content (enveloped).<BR />- Or the signature xml tree can contain the content as a subtree (enveloping).<BR />- Alternatively, the Signature xml tree can be detached from the content and live as standalone xml.</P><P><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>&nbsp;&nbsp;a process of creating a hash of the desired content and in addition creating a signature over a part of the signature itself.</P><P data-unlink="true"><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>&nbsp;&nbsp;an xml structure for storing the signature and digest, that are required for verification.</P><H2 id="toc-hId--1215643235">Next Steps</H2><P>Go through the <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-manually-sign-verify-xml-payload-based-on-xml-signature/ba-p/13671049" target="_blank">tutorial in the next blog post</A> to gain hands-on experience.</P><H2 id="toc-hId--1412156740">Links</H2><P><U>SAP Help Portal<BR /></U>Docu for&nbsp;<SPAN><A href="https://help.sap.com/docs/CLOUD_INTEGRATION/368c481cd6954bdfa5d0435479fd4eaf/463a9085156d4672bc4ee9095277e453.html" target="_blank" rel="noopener noreferrer">Message-Level Security</A></SPAN></P><P><U>Specs<BR /></U>XML Signature:&nbsp;<A href="https://www.w3.org/TR/xmldsig-core/" target="_blank" rel="noopener nofollow noreferrer">https://www.w3.org/TR/xmldsig-core/</A><BR />C14n Version 1.1 <A href="https://www.w3.org/TR/xml-c14n/" target="_blank" rel="noopener nofollow noreferrer">https://www.w3.org/TR/xml-c14n/</A><BR />C14N Version 2 (2013) <A href="https://www.w3.org/TR/xml-c14n2/" target="_blank" rel="noopener nofollow noreferrer">https://www.w3.org/TR/xml-c14n2/</A><BR />Exclusive c14n Vers 1 <A href="https://www.w3.org/TR/xml-exc-c14n/" target="_blank" rel="noopener nofollow noreferrer">https://www.w3.org/TR/xml-exc-c14n/</A></P><P><U>Info<BR /></U>Wikipedia: CHF, Cryptographic&nbsp;<SPAN><A href="https://en.wikipedia.org/wiki/Cryptographic_hash_function" target="_blank" rel="noopener nofollow noreferrer">Hash Function</A></SPAN><BR />Wikipedia:&nbsp;<SPAN><A href="https://en.wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions" target="_blank" rel="noopener nofollow noreferrer">Comparison</A></SPAN>&nbsp;of cryptographic hash functions<BR />Wikipedia: Digital&nbsp;<SPAN><A href="https://en.wikipedia.org/wiki/Digital_signature" target="_blank" rel="noopener nofollow noreferrer">Signature</A></SPAN></P><P><U>Libs</U><BR />Apache&nbsp;<SPAN><A href="https://santuario.apache.org/index.html" target="_blank" rel="noopener nofollow noreferrer">Santuario</A>&nbsp;implements XML Enc and DigiSigi standards.</SPAN></P><P><U>Blogs</U><BR />Understanding the <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-the-xml-encryption-standard/ba-p/13630124" target="_blank">XML Encryption</A> standard.<BR /><A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-pkcs-7-cms-standard/ba-p/13560268" target="_blank">Understanding</A>&nbsp;CMS (PKCS 7) standard.<BR />Understanding the PKCS7/CMS <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-pkcs-7-cms-signer/ba-p/13555514" target="_blank">Signer</A><BR /><SPAN><A href="https://blogs.sap.com/2022/11/04/sap-btp-security-glossary/" target="_blank" rel="noopener noreferrer">Security Glossary</A></SPAN>&nbsp;Blog</P><H2 id="toc-hId--1608670245">Appendix: C14N Test Code</H2><P data-unlink="true">To get below code working, the Apache Santuario library is required.<BR />It can be downloaded from here:&nbsp;<A href="https://mvnrepository.com/artifact/org.apache.santuario/xmlsec" target="_blank" rel="noopener nofollow noreferrer">https://mvnrepository.com/artifact/org.apache.santuario/xmlsec</A><BR />Alternatively, below snippet can be added to your Maven dependencies section:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;dependency&gt; &lt;groupId&gt;org.apache.santuario&lt;/groupId&gt; &lt;artifactId&gt;xmlsec&lt;/artifactId&gt; &lt;version&gt;4.0.2&lt;/version&gt; &lt;/dependency&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P data-unlink="true">This test class is for your convenience:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>package example.c14n; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.charset.StandardCharsets; import org.apache.xml.security.c14n.Canonicalizer; import org.apache.xml.security.utils.XMLUtils; import org.w3c.dom.Document; import org.w3c.dom.Node; /** Using Apache Santuario library for canonicalizing different XML payloads */ public class CanonTest { public static void main(String unused[]) throws Exception { org.apache.xml.security.Init.init(); // example for handling comment and basics String xmlSimple = "" + "&lt;!-- my comment --&gt;" + "&lt;parent &gt;" + "&lt;child batt='yes' att='no' /&gt;" + "&lt;/parent&gt;"; // apply different canonicalization methods canoFull(xmlSimple, Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS); canoFull(xmlSimple, Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS); // example for handling namespaces String xmlWithNs = "" + "&lt;parent " + "xmlns:pans='/pauri' " + "xmlns:chns='/churi'&gt;" + "&lt;child chns:att='good'/&gt;" + "&lt;friend pans:att='OK' chns:att='cool' /&gt;" + "&lt;brother/&gt;" + "&lt;/parent&gt;"; // apply different canonicalization methods on different subtrees canoSubtree(xmlWithNs, "child", Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS); canoSubtree(xmlWithNs, "child", Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS); canoSubtree(xmlWithNs, "friend", Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS); canoSubtree(xmlWithNs, "brother", Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS); canoSubtree(xmlWithNs, "brother", Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS); } private static void canoFull(String xml, String c14nMethod) throws Exception { System.out.println("\n\n- - - " + c14nMethod + " - - - \n"); Canonicalizer canon = Canonicalizer.getInstance(c14nMethod); canon.canonicalize(xml.getBytes(), System.out, false); } private static void canoSubtree(String xml, String element, String c14nMethod) throws Exception { System.out.println("\n\n- - - " + c14nMethod + " - - - \n"); InputStream stream = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)); Document doc = XMLUtils.read(stream, true); Node myChild = (Node)doc.getElementsByTagName(element).item(0); Canonicalizer canon = Canonicalizer.getInstance(c14nMethod);//Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS canon.canonicalizeSubtree(myChild, System.out); } }</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P data-unlink="true">&nbsp;</P><P data-unlink="true">&nbsp;</P><P data-unlink="true">&nbsp;</P><P data-unlink="true">&nbsp;</P> 2024-04-15T10:23:50.369000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-manually-sign-verify-xml-payload-based-on-xml-signature/ba-p/13671049 Cloud Integration: Manually Sign / Verify XML payload based on XML Signature Standard 2024-04-16T10:48:33.918000+02:00 CarlosRoggan https://community.sap.com/t5/user/viewprofilepage/user-id/5495 <P><STRONG>SAP Cloud Integration&nbsp;</STRONG><SPAN>offers iFlow steps for signing and verifying XML content according to the "XML Signature" standard.&nbsp;</SPAN>Nevertheless, there are use cases that require configurations that are not supported by the iFlow steps. Fortunately, in such cases we still can use Groovy scripts for manually sign or verify message payloads according to the requirements.<BR />This blog post provides an entry point for creating Groovy scripts for signature creation and verification, based on the “XML Signature” standard.<BR /><SPAN>This standard provides some benefits and flexibility specifically for xml content and was explained in my <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-the-xml-digital-signature-standard/ba-p/13668160" target="_blank">previous blog post</A>.&nbsp;</SPAN><BR />This blog post covers<BR /><SPAN><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&nbsp;SAP Cloud Integration on Cloud Foundry<BR /></SPAN><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&nbsp;Groovy / Java<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>&nbsp;org.apache.santuario library</P><H2 id="toc-hId-992491943">Content</H2><P>Prerequisites<BR />Intro<BR />1. Create Key Pair<BR />2. Create iFlow<BR />&nbsp; &nbsp; 2.1.&nbsp; Create iFlow<BR />&nbsp; &nbsp; 2.2. Upload library<BR />&nbsp; &nbsp; 2.3. Groovy Script for Signing<BR />&nbsp; &nbsp; 2.4. Groovy Script for Verification<BR />3. Run<BR />Appendix 1: Sample XML Payload<BR />Appendix 2: Sample Groovy Script for Signing<BR />Appendix 3: Sample Groovy Script for Verification<BR />Appendix 4: Maven pom file</P><H2 id="toc-hId-795978438">Prerequisites</H2><P data-unlink="true"><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span><SPAN>CPI<BR /></SPAN><SPAN>To follow this tutorial, access to a Cloud Integration tenant is required, as well as basic knowledge about creating iFlows.<BR /></SPAN><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Maven<BR />While not required, it is an advantage to have<SPAN>&nbsp;</SPAN><A href="https://maven.apache.org/download.cgi" target="_blank" rel="noopener nofollow noreferrer">maven</A><SPAN>&nbsp;</SPAN>installed.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Understanding the "XML Signature" standard&nbsp; is not difficult when reading the <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-the-xml-digital-signature-standard/ba-p/13668160" target="_blank">previous blog post</A>.<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>For remaining open questions I recommend the&nbsp;<SPAN><A href="https://blogs.sap.com/2022/11/04/sap-btp-security-glossary/" target="_blank" rel="noopener noreferrer">Security Glossary</A></SPAN>.</P><H2 id="toc-hId-599464933">Introduction</H2><P>After going through the <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-the-xml-digital-signature-standard/ba-p/13668160" target="_blank">previous blog post</A>, we’re well prepared for the hands-on tutorial in this post.</P><P><U>Scenario<BR /></U>In our Cloud Integration scenario, a sales order XML payload must be signed because it contains sensitive information (order data).<BR />To make things easier, we hard-code the sample xml payload in the iFlow.<BR />In a Groovy script, we sign only the subnode which contains the important info.<BR />This is possible thanks to the “XML Signature” standard.<BR />To prove that the new XML payload, which contains the signature part, can be verified, we add another Groovy script.<BR />This one performs the signature verification.</P><P><U>Recap<BR /></U>The “XML Signature” standard allows to sign:<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>The whole message (enveloping)<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>A specific node, means the node itself plus its content (enveloped)</P><P>In our tutorial, we’re going for the second option.<BR />The standard defines an additional XML tree that is inserted in the original document, next to the sensitive content.<BR />This new XML tree has the root node <FONT color="#339966">&lt;Signature&gt;</FONT>.</P><P><U>The sample payload<BR /></U>We’re keeping things as simple as possible, so we’re using this simple sample payload:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="sampleContent.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96648iFB470FE999016694/image-size/medium?v=v2&amp;px=400" role="button" title="sampleContent.jpg" alt="sampleContent.jpg" /></span></P><P>We want to sign the &lt;order&gt; node.<BR />This ensures that neither the receiving customer nor the bought product are altered during message processing.<BR />To be more precise:<BR />The data might be altered, as it is not encrypted. But in that case, it would be detected, because the verification would fail.<BR />Why we don’t encrypt it?<BR />Because encryption is usually applied to secret content. In our example the content is not secret, as it doesn’t contain e.g. a credit card number.</P><P>Below screenshot shows the payload before and after signing:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="intro_before_after.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96647i8EC8A50724AADFFD/image-size/medium?v=v2&amp;px=400" role="button" title="intro_before_after.jpg" alt="intro_before_after.jpg" /></span></P><P>&nbsp;</P><P><U>The signing process<BR /></U>In the Groovy script, we’re using the <A href="https://santuario.apache.org/index.html" target="_blank" rel="noopener nofollow noreferrer">Apache Santuario</A> library, which provides an implementation of the “XML Signature” standard.<BR />This means it is aware of the XML structure and the signing process that is defined in the standard.<BR />It is also aware of the algorithms that are supported in the specification.</P><P>So what we have to&nbsp; do in the code:<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Compose the additional xml tree, using the objects which are offered in the library.<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Provide the required&nbsp; private key (public key optional).<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Choose the XML node that should be signed.<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Feed the signer with that node.</P><P>Note:<BR />It is clearly recommended to use xPath for retrieving the xml node that should be verified.<BR />The reason is that xPath helps to validate the xml structure of the whole document, as well.<BR />However, to keep the sample code as simple as possible, I decided not to use xPath.<BR />Please make sure to always use xPath in your productive code.</P><P><FONT size="2" color="#999999">Disclaimer:</FONT><BR /><FONT size="2" color="#999999">This blog post is not an official recommendation, this is not safe and not ready to be pasted into productive environment.</FONT><BR /><FONT size="2" color="#999999">This is just a simplified tutorial to get everybody started.</FONT></P><H2 id="toc-hId-402951428">1. Create Key Pair</H2><P>There are multiple possibilities for creating a key pair.&nbsp;<BR />A simple way would be to use CPI, it's fine for following this tutorial.</P><P>Using the built-in functionality of CPI to generate a key pair has the following advantage:<BR />The private key is generated at CPI, where it is needed.<BR />The private key never leaves CPI (it is not possible to download it)<BR />The private key does not need to be uploaded to CPI via net.<BR />The disadvantage would be that this private key cannot be used locally, as it is not possible to&nbsp; download it.</P><P><U>Ceate Key Pair in CPI</U></P><P>We go to keystore and choose "Create -&gt; Key Pair"<BR />We enter some data of your choice, e.g.<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>Alias: &nbsp;“demokeypair”<BR /><span class="lia-unicode-emoji" title=":small_orange_diamond:">🔸</span>CN: “demokeypair”<BR />It will be used for creating the certificate.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="createKeyPair.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96704i75B4F097FBAAB7BF/image-size/medium?v=v2&amp;px=400" role="button" title="createKeyPair.jpg" alt="createKeyPair.jpg" /></span></P><P>&nbsp;<SPAN>The alias name “demokeypair” will be used below in the Groovy scripts, in order to load the keys.</SPAN></P><P>Note.<BR />If you need examples of creating <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-how-to-combine-openssl-with-encryptor-and-signer/ba-p/13565504" target="_blank">key pairs</A> or <A href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-amqp-adapter-client-certificate-solace-pubsub-2/ba-p/13646997" target="_blank">certificate chains</A> with OpenSSL, please refer my other blog posts.</P><H2 id="toc-hId-206437923">2. Create iFlow</H2><P>In this section, we’re creating a simple iFlow that does nothing but sign and verify a hard-coded xml-message.</P><H3 id="toc-hId-139007137"><U>2.1. The iFlow</U></H3><P>Our iFlow will look as follows:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iFlow.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78342i00A424CDBBF8EC72/image-size/medium?v=v2&amp;px=400" role="button" title="iFlow.png" alt="iFlow.png" /></span></P><P>&nbsp;Let’s quickly go through the configuration.</P><P><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>Timer<BR />We define a start event via "Timer" with default properties, i.e. run once<BR /><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>&nbsp; Content Modifier<BR />We use a "Content Modifier" in order to hard-code a dummy xml-payload in the "Message Body".<BR />It represents an incoming HTTP request (or similar).&nbsp;<BR />The content is copied from Appendix 1<BR /><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>&nbsp;Groovy Script1<STRONG><BR /></STRONG>The script used for signing.<BR />The content is copied from Appendix 2<BR /><span class="lia-unicode-emoji" title=":large_blue_diamond:">🔷</span>&nbsp;Groovy Script2<STRONG><BR /></STRONG>The script used for verification.<BR />The content is copied from Appendix 3</P><H3 id="toc-hId--57506368"><U>2.2. The security library</U></H3><P>In our Groovy code, we’re using the library <A href="https://santuario.apache.org/index.html" target="_blank" rel="noopener nofollow noreferrer">Apache Santuario</A>.<BR />It is an implementation of the "XML Signature" standard, thus perfect for our needs.<BR />The drawback: the library is not available in the CPI Java runtime.<BR />We need to manually get hold of the <FONT face="courier new,courier">.jar</FONT> file and upload it to the iFlow.</P><P><U>2.2.1. Download the "xmlsec" jar file</U></P><P>A common place to find and download jar files is the "<A href="https://mvnrepository.com/" target="_blank" rel="noopener nofollow noreferrer">mavenrepository</A>".&nbsp;&nbsp;<BR />We find our library at <A href="https://mvnrepository.com/artifact/org.apache.santuario/xmlsec" target="_blank" rel="noopener nofollow noreferrer">https://mvnrepository.com/artifact/org.apache.santuario/xmlsec</A><BR />We choose a version (in my example: <FONT face="courier new,courier">4.0.2</FONT>)<BR />We click on "bundle" to download the jar file.<BR />in my example the file name is <FONT face="courier new,courier">xmlsec-4.0.2.jar</FONT>.</P><P>Alternatively: use maven as described in Appendix 4.</P><P><U>2.2.2. Upload</U></P><P>To make the jar file available for our scripts in the iFlow, we open our iFlow.<BR />To make sure that nothing is selected, we click on the background of the designer.<BR />At the “Integration Flow” properties, we open the tab “References”, then click on “Add -&gt; Archive”.<BR />We browse to our jar file and confirm the dialog.<BR />That’s it.</P><H3 id="toc-hId--254019873">&nbsp;<U>2.3. The Groovy Script for Signing</U></H3><P>Now let’s go through the code for signing xml payload according to the "XML Signature" standard.</P><P><U>Preparation</U></P><P>A brief look at the required packages:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>import com.sap.it.api.ITApiFactory import javax.xml.* import org.w3c.*</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>We need some basic functionality for dealing with xml (not surprising in case of XML payload).<BR />We cannot use native groovy xml-parsing, we need <FONT face="courier new,courier">org.w3c</FONT>&nbsp;because the apache library is based on it.<BR />For the security related operations, we use some native Java packages:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>import java.security.* import javax.crypto.*</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>And finally, the protagonist, the XML Security implementation of Apache Santuario:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>import org.apache.xml.security.*</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Note:<BR />I think it is definitely important to rely on a public implementation of the security standard and not to implement the single steps manually.<BR />Reasons are the compatibility, flexibility of the standard, secure implementation, vulnerability-fixes that come with the library.</P><P>First thing we have to do is to initialize the apache library:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>org.apache.xml.security.Init.init();</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P><U>Key Pair</U></P><P>At the beginning, let’s retrieve the key pair, as both keys will be required in the script.<BR />The key pair which is stored in the CPI keystore can be fetched using the CPI runtime API.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>KeystoreService keystoreService = ITApiFactory.getService(KeystoreService.class, null) KeyPair keyPair = keystoreService.getKeyPair(alias) return keyPair.getPrivate()</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P><U>Parse xml string</U></P><P>Next first thing we have to do is to read the xml message and to parse it into a <FONT face="courier new,courier">org.w3c.Document</FONT> instance, with the help of our helper method:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>Document document = convertToDocument(message.getBody(InputStream.class))</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>We need this <FONT face="courier new,courier">document</FONT> instance later.</P><P>It is our task to compose the <FONT face="courier new,courier" color="#008000">&lt;Signature&gt;</FONT> subtree, according to our needs and with the desired configurations.<BR />As we know from the <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-the-xml-digital-signature-standard/ba-p/13668160" target="_blank">introduction blog post </A>we need to specify the algorithms for signature, for digest, for canonicalization.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>XMLSignature signature = new XMLSignature(doc, "", XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1) rootElement.appendChild(signature.getElement())</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Note:<BR />The empty string parameter above is used to specify a base URI, in case that relative URLs are used in the document.<BR />Above code places the <FONT face="courier new,courier" color="#008000">&lt;Signature&gt;</FONT> element below the root. We can do so, because we know that the &lt;order&gt; element is a child of root as well. What we want to do is to have the <FONT face="courier new,courier" color="#008000">&lt;Signature&gt;</FONT> subtree as sibling of the <FONT face="courier new,courier">&lt;order&gt;</FONT> node which we are signing.</P><P><BR />The <FONT face="courier new,courier" color="#008000">&lt;Reference&gt;</FONT> element is composed implicitly, but we have to create the children, like&nbsp;<FONT face="courier new,courier" color="#008000">&lt;Transform&gt;</FONT> elements.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>Transforms transforms = new Transforms(doc); transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE); transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P><U>KeyInfo</U><BR />The <FONT face="courier new,courier" color="#008000">&lt;KeyInfo&gt;</FONT> element is optional.<BR />It allows to send the public key along with the message. This makes it easier for the receiver to verify the signature.<BR />However, if the receiver already has the public key, then it doesn’t need to be sent.<BR />In our example, we have the public key in the keystore, so we don’t really have to send it.<BR />On the other side, we want to showcase how it could be done.</P><P>Note:<BR />Instead of the public key, we could also send the certificate, which contains the public key.<BR />This has the benefit that the metadata of the certificate could be validated by the recipient.<BR />Another option would be to send only the serial number (or similar) of the certificate, assuming that the receiver has the certificate already and only needs to find the right one and to validate some metadata.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>signature.addKeyInfo(publicKey)</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P><U>addDocument</U></P><P>Some explanation is required with respect to the xml element which should be signed.<BR />In the corresponding method, this element has to be specified by a String which is a URI:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>signature.addDocument("#id_1", transforms, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256); </code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>This URI (first method parameter) can be relative (using the "#" notation) or it can point to any other xml, as specified by the XML Signature spec.<BR />This is nice and flexible.<BR />However, internally, it requires that the targeted element can be identified by an “ID”.<BR />Defining an “ID” attribute for an xml element is not so simple:<BR />We cannot just create an attribute with name “ID” or “id” or “Id”.<BR />If we create such an attribute, it would be just a normal attribute with any name.<BR />It has to be marked as a special “ID”-attribute.<BR />This can be done with an XML scheme.<BR />Or it can be done programmatically.<BR />That’s what we’re doing in our sample, it seems the easier way.<BR />We call our helper method:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>setIdAttribute(doc, "order", "identifier")</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>which is implemented as follows:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>def setIdAttribute(Document doc, String elementName, String idAttributeName) { Element orderElemToVerify = (Element)doc.getElementsByTagName(elementName).item(0); orderElemToVerify.setIdAttribute(idAttributeName, true); }</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Note that in your productive code this is probably not required.</P><P><U>Sign</U></P><P>Finally, the signature is created by providing the private key:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code> signature.sign(privateKey)</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>All other configuration has been done before.</P><P>Note:<BR />As usual, we're skipping all error handling, to make the code sample easier to read.</P><P><U>Output</U></P><P>That’s all for the signing.<BR />At the end, we only need to convert the <FONT face="courier new,courier">org.w3c.Document</FONT> instance to a string and set it as message body of the iFlow.</P><P><U>Summary</U></P><P><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Prepare document<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Fetch Keys<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Compose &lt;Signature&gt; node<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Here: set ID attribute<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Sign the desired element</P><H3 id="toc-hId--450533378"><U>2.4. The Groovy Script for Verification</U></H3><P>The verification script is much shorter because the library is in charge of finding the required elements within&nbsp; the XML.<BR />We only need to take care of properly initializing the lib.</P><P><U>Prepare XML Document</U></P><P>We&nbsp; need to convert the XML message payload from string to <FONT face="courier new,courier">org.w3c.Document:</FONT></P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>Document document = convertToDocument(message.getBody(InputStream.class))</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Again, we need to configure the attribute which we want to act as “ID”:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>setIdAttribute(docToVerify, "order", "identifier")</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Next, we have to get a hold of the element which represents the <FONT face="courier new,courier" color="#008000">&lt;Signature&gt;</FONT>, then wrap it in an XMLSignature object:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>Element sigElement = (Element) docToVerify.getElementsByTagNameNS(Constants.SignatureSpecNS, "Signature").item(0) XMLSignature verifySig = new XMLSignature(sigElement, "")</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Note:<BR />As mentioned, that code should be replaced by xPath!</P><P>For verification, we need the public key, so we fetch it from CPI keystore.<BR />Note:<BR />As per design, everybody should be enabled to verify a signature, that’s why the verification is done with a public key (not private key).</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>PublicKey publicKey = getPublicKeyFromKeystore("demokeypair") </code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Note:<BR />We’re making our lives too easy, you might think, by taking the public key from keystore instead of reading it from the XML.<BR />The answer is yes, correct.<BR />And the reason is that I’m planning to publish another tutorial for more use cases.</P><P>Finally, do the verification:</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>boolean verificationResult = verifySig.checkSignatureValue(publicKey)</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>The verification is a simple check method that returns a Boolean.</P><P>In our simple sample, we just print the result to the console.<BR />In productive world, the iFlow should fail, an exception should be thrown, etc&nbsp; &nbsp; &nbsp;&nbsp;</P><P><U>Little summary</U></P><P><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Find the <FONT color="#339966">&lt;Signature&gt;</FONT> node in the XML payload<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Fetch the public key<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>Configure an <FONT face="courier new,courier">XMLSignature</FONT>&nbsp;and run the check.</P><H2 id="toc-hId--776129602">3. Run Scenario</H2><P>At this point we’ve created a very simple iFlow with hard-coded xml-payload, signing script and verification script.<BR />The scripts produce log output, such that we can view the message content before and after each step.</P><P>Finally, we can deploy the iFlow, I will be triggered automatically and we can view the results in the log at<BR /><EM>Monitor -&gt; Integrations -&gt; Monitor Message Processing -&gt; All Artifacts</EM></P><H2 id="toc-hId--625388750">Summary</H2><P>After learning the “XML Signature” standard in the previous blog post, today we applied the learnings in java code, based on the Apache Santuario implementation of the standard.<BR />The <EM>Santuario</EM> library knows the structure and the process of creating an “XML Signature”, we only need to collect the required information and configure the library objects:<BR />For signing, we need:<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>the signature mode, in our example “enveloped”<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>the XML element to be signed<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>the Canonicalization method<BR /><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>the Digest alg: e.g. SHA256&nbsp; (used to calculate a hash of the signed message)<BR /><SPAN><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>the Signature alg: e..g SHA256withRSA<BR /></SPAN><span class="lia-unicode-emoji" title=":small_blue_diamond:">🔹</span>the Certificate or public key or metadata, required for verification, to be sent in the &lt;KeyInfo&gt; element</P><P>When it comes to verification, the library will extract all required info from the <FONT face="courier new,courier" color="#008000">&lt;Signature&gt;</FONT> element.<BR />We only need to help to find it.<BR />Also, we need to take care of the public &nbsp;key, which may be included in the <FONT face="courier new,courier" color="#008000">&lt;KeyInfo&gt;</FONT> subnode, or we have it already and may want to compare the certificate metadata.<BR />And again (for the last time):<BR />The XML structure as a whole should be validated as well.<BR />Therefore, xPath should be used</P><H2 id="toc-hId--821902255">Links</H2><P><U>Specification</U><BR />W3C recommendation&nbsp;<SPAN>XML Signature:&nbsp;</SPAN><A href="https://www.w3.org/TR/xmldsig-core/" target="_blank" rel="noopener nofollow noreferrer">https://www.w3.org/TR/xmldsig-core/</A></P><P><U>Java library</U><BR />Apache <A href="https://santuario.apache.org/index.html" target="_blank" rel="noopener nofollow noreferrer">Santuario</A></P><P><U>Blogs</U><BR />Intro Blog : Understanding the "<A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-the-xml-digital-signature-standard/ba-p/13668160" target="_blank">XML Signature</A>" standard.<BR />Understanding the <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-cloud-integration-understanding-pkcs-7-cms-standard/ba-p/13560268" target="_blank">CMS (PKCS7)</A> Standard.<BR />The <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-btp-security-glossary/ba-p/13562676" target="_blank">Security Glossary</A>.</P><H2 id="toc-hId--1018415760">Appendix 1: Sample XML Payload</H2><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;SalesService&gt; &lt;order identifier="id_1"&gt; &lt;customer&gt;Joe&lt;/customer&gt; &lt;product&gt;cat&lt;/product&gt; &lt;/order&gt; &lt;/SalesService&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><H2 id="toc-hId--1214929265">Appendix 2: Sample Groovy Script for Signing</H2><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>import com.sap.gateway.ip.core.customdev.util.Message import com.sap.it.api.ITApiFactory import com.sap.it.api.keystore.KeystoreService import java.io.ByteArrayOutputStream import java.io.InputStream import java.security.KeyPair import java.security.Key import java.security.PrivateKey import java.security.PublicKey import javax.xml.parsers.DocumentBuilder import javax.xml.parsers.DocumentBuilderFactory import javax.xml.transform.OutputKeys import javax.xml.transform.Transformer import javax.xml.transform.TransformerFactory import javax.xml.transform.dom.DOMSource import javax.xml.transform.stream.StreamResult import org.apache.xml.security.signature.XMLSignature import org.apache.xml.security.transforms.Transforms import org.apache.xml.security.utils.Constants import org.apache.xml.security.keys.KeyInfo import org.apache.xml.security.utils.XMLUtils import org.w3c.dom.Document import org.w3c.dom.Element import org.xml.sax.InputSource /* the main method */ def Message processData(Message message) { def signedDocument = doSign(message) def signedDocAsString = convertDocumentToString(signedDocument) message.setBody(signedDocAsString) return message } /* Sign */ def Document doSign(message) throws Exception { org.apache.xml.security.Init.init() PrivateKey privateKey = getPrivateKeyFromKeystore("demokeypair") PublicKey publicKey = getPublicKeyFromKeystore("demokeypair") Document doc = convertToDocument(message.getBody(InputStream.class)) writeToLog (doc, message, "Before signing:\n") Element rootElement = doc.getDocumentElement() rootElement.normalize() // signature object XMLSignature signature = new XMLSignature(doc, "", XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1) rootElement.appendChild(signature.getElement()) // set transforms Transforms transforms = new Transforms(doc) transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE) transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS) // set the element to be signed: the &lt;order&gt; element //the &lt;order&gt; should be signed. The FWK finds it by "id", so we have to set the "identifier" attr as id-attribute (alternatively, do with scheme) setIdAttribute(doc, "order", "identifier") signature.addDocument("#id_1", transforms, Constants.ALGO_ID_DIGEST_SHA1) // the URI references an elem by id via this notation //the &lt;KeyInfo&gt; section contains the public key, to be used by recipient for verification signature.addKeyInfo(publicKey) // sign signature.sign(privateKey) writeToLog (doc, message, "After signing:\n") return doc } /* Helper */ def Document convertToDocument(InputStream stream){ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() factory.setNamespaceAware(true) DocumentBuilder builder = factory.newDocumentBuilder() return builder.parse(new InputSource(stream)) } def String convertDocumentToString(Document document){ ByteArrayOutputStream outputStream = new ByteArrayOutputStream() XMLUtils.outputDOM(document, outputStream) return outputStream.toString() } def setIdAttribute(Document doc, String elementName, String idAttributeName) { Element orderElemToVerify = (Element)doc.getElementsByTagName(elementName).item(0) orderElemToVerify.setIdAttribute(idAttributeName, true) } def PrivateKey getPrivateKeyFromKeystore(alias){ KeystoreService keystoreService = ITApiFactory.getService(KeystoreService.class, null) KeyPair keyPair = keystoreService.getKeyPair(alias) return keyPair.getPrivate() } def PublicKey getPublicKeyFromKeystore(alias){ KeystoreService keystoreService = ITApiFactory.getService(KeystoreService.class, null) KeyPair keyPair = keystoreService.getKeyPair(alias) return keyPair.getPublic() } def writeToLog(doc, message, text){ StringWriter stringWriter = new StringWriter() Transformer transformer = TransformerFactory.newInstance().newTransformer() transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes") transformer.setOutputProperty(OutputKeys.METHOD, "xml") transformer.setOutputProperty(OutputKeys.INDENT, "yes") transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8") transformer.transform(new DOMSource(doc), new StreamResult(stringWriter)) def messageLog = messageLogFactory.getMessageLog(message) messageLog.addAttachmentAsString("Sign", text + stringWriter.toString(), "text/plain") return stringWriter.toString() }</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><H2 id="toc-hId--1411442770">Appendix 3: Sample Groovy Script for Verification</H2><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>import com.sap.gateway.ip.core.customdev.util.Message; import com.sap.it.api.ITApiFactory; import com.sap.it.api.keystore.KeystoreService; import java.io.ByteArrayOutputStream; import java.io.InputStream import java.security.KeyPair; import java.security.PublicKey; import javax.crypto.KeyGenerator; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.apache.xml.security.signature.XMLSignature; import org.apache.xml.security.transforms.Transforms; import org.apache.xml.security.utils.Constants; import org.apache.xml.security.keys.KeyInfo; import org.apache.xml.security.utils.XMLUtils import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.InputSource; /* The main method */ def Message processData(Message message) { doVerify(message) return message } /* Verify */ def doVerify(message) throws Exception { org.apache.xml.security.Init.init(); Document docToVerify = convertToDocument(message.getBody(InputStream.class)) writeToLog (docToVerify, message, "Before verify:\n") //prepare the id-attribute setIdAttribute(docToVerify, "order", "identifier"); // compose the signature object Element sigElement = (Element) docToVerify.getElementsByTagNameNS(Constants.SignatureSpecNS, "Signature").item(0); // TODO replace this with xPath XMLSignature signature = new XMLSignature(sigElement, ""); PublicKey publicKey = getPublicKeyFromKeystore("demokeypair") // run the verification check boolean verificationResult = signature.checkSignatureValue(publicKey); writeToLog (null, message, "Verification Result: " + Boolean.toString(verificationResult)) } /* Helpers */ def setIdAttribute(Document doc, String elementName, String idAttributeName) { Element element = (Element)doc.getElementsByTagName(elementName).item(0); element.setIdAttribute(idAttributeName, true); } def PublicKey getPublicKeyFromKeystore(alias){ KeystoreService keystoreService = ITApiFactory.getService(KeystoreService.class, null) KeyPair keyPair = keystoreService.getKeyPair(alias) return keyPair.getPublic() } def Document convertToDocument(InputStream stream){ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new InputSource(stream)); } def String convertDocumentToString(Document document){ ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); XMLUtils.outputDOM(document, outputStream); return outputStream.toString() } def writeToLog(doc, message, text){ def messageLog = messageLogFactory.getMessageLog(message) if(doc == null){ messageLog.addAttachmentAsString("Verify", text, "text/plain") return } StringWriter stringWriter = new StringWriter() Transformer transformer = TransformerFactory.newInstance().newTransformer() transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes") transformer.setOutputProperty(OutputKeys.METHOD, "xml") transformer.setOutputProperty(OutputKeys.INDENT, "yes") transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8") transformer.transform(new DOMSource(doc), new StreamResult(stringWriter)) messageLog.addAttachmentAsString("Verify", text + stringWriter.toString(), "text/plain") }</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><H2 id="toc-hId--1607956275">Appendix 4: Maven pom file</H2><P>Create a maven project and enter the following dependency in the dependencies section.<BR />Note that you might need to adapt the version.<BR />Today, the current version is 4.0.2.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-markup"><code>&lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.santuario&lt;/groupId&gt; &lt;artifactId&gt;xmlsec&lt;/artifactId&gt; &lt;version&gt;4.0.2&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt;</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Run the command<BR /><FONT face="courier new,courier">mvn package</FONT><BR />Maven will download the dependencies to the local repository at<BR /><FONT face="courier new,courier">C:\Users\joe\.m2\repository\org\apache\santuario\xmlsec\4.0.2\xmlsec-4.0.2.jar</FONT><BR />From here it can be uploaded to CPI.</P><P>&nbsp;</P> 2024-04-16T10:48:33.918000+02:00 https://community.sap.com/t5/technology-blogs-by-members/magic-numbers-a-solution-to-foreign-characters-in-sap-cpi/ba-p/13634359 Magic Numbers : A Solution to Foreign Characters in SAP CPI 2024-04-19T15:47:08.914000+02:00 shayanmajumder https://community.sap.com/t5/user/viewprofilepage/user-id/891395 <H2 id="toc-hId-988890146">Introduction</H2><P>While using SAP CPI a consultant often faces a task of sending various types of files to an external SFTP server however more than often just simply defining the file type in the file extension is not enough. There are cases when even though we have the proper extension the file is not properly deciphered by the relevant software. Hence it becomes crucial to hardcode the encoding of the file before it is being sent to the SFTP.</P><P><SPAN>Byte Order Marker (BOM) is used to define encoding and byte order in a file. Usually taking form as an encoded sequence of bytes, BOM aids software in deciphering endianness or byte order for multibyte character encodings such as UTF-16 and UTF-32. The BOMs are also sometimes referred as <STRONG>Magic Numbers</STRONG> which are specific bytes at the beginning of a file that distinguish it as a certain file type. They are also known as file signatures and can help the system identify files even without a file extension.</SPAN></P><H3 id="toc-hId-921459360"><SPAN>Advantages of using byte order marker include:</SPAN></H3><OL><LI><SPAN>The Byte Order Mark (BOM) plays a crucial role in identifying the character encoding of a text file, especially within Unicode. Given that various encodings may coexist such as UTF-8, UTF-16 and UTF-32; the BOM distinguishes between them an operation particularly useful for those actively working with these different implications of Unicode.</SPAN></LI><LI>The Byte Order Mark (BOM) serves as a byte order indication for encodings such as UTF-16, where the significance lies in their byte order (endianness). This specific sequence of bytes indicates whether the least significant or most significant byte precedes it.</LI><LI><SPAN>The inclusion of Byte Order Mark (BOM) can significantly enhance compatibility, particularly in environments where diverse systems or software might interpret text files with variance; thus the use of a BOM helps guarantee that supporting programs will correctly decipher the text file.</SPAN></LI></OL><H3 id="toc-hId-724945855">Different types of byte order markers</H3><TABLE width="497px"><TBODY><TR><TD width="153.35px" height="57px"><STRONG>Encoding </STRONG></TD><TD width="185.45px" height="57px"><STRONG>Representation (hexadecimal) </STRONG></TD><TD width="157.4px" height="57px"><STRONG>Unicode String Format</STRONG></TD></TR><TR><TD width="153.35px" height="30px">UTF-8</TD><TD width="185.45px" height="30px">EF BB BF</TD><TD width="157.4px" height="30px">\uFEFF</TD></TR><TR><TD width="153.35px" height="30px">UTF-16, big-endian</TD><TD width="185.45px" height="30px">FE FF</TD><TD width="157.4px" height="30px">\uFFFE</TD></TR><TR><TD width="153.35px" height="30px">UTF-16, little-endian</TD><TD width="185.45px" height="30px">FF FE</TD><TD width="157.4px" height="30px">\uFEFF</TD></TR><TR><TD width="153.35px" height="30px">UTF-32, big-endian</TD><TD width="185.45px" height="30px">00 00 FE FF</TD><TD width="157.4px" height="30px">\u0000\u0000\uFEFF</TD></TR><TR><TD width="153.35px" height="30px">UTF-32, little-endian</TD><TD width="185.45px" height="30px">FF FE 00 00</TD><TD width="157.4px" height="30px">\uFEFF\u0000\u0000</TD></TR><TR><TD width="153.35px" height="30px">UTF-7</TD><TD width="185.45px" height="30px">2B 2F 76 38 2B 2F 76 39</TD><TD width="157.4px" height="30px">+/v8+/v9</TD></TR></TBODY></TABLE><P>A <SPAN>comprehensive list of all file magic numbers can be found <A href="https://www.garykessler.net/library/file_sigs.html" target="_self" rel="nofollow noopener noreferrer">here</A>.</SPAN></P><H3 id="toc-hId-528432350">Using BOM in SAP CPI Groovy Script</H3><P>Suppose we need to send a simple CSV to a SFTP which contains some Chinese characters. If we do not encode it using BOM and try opening it using excel the output will be shown as:</P><P style=" text-align: center; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_0-1710239138066.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79139i18112125D848D49C/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_0-1710239138066.png" alt="shayanmajumder_0-1710239138066.png" /></span></P><P>However when we encode it using BOM using the following code the output will be as follows:</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>def csvString = "Name,Age,City,ChineseText\nJohn,30,Beijing,你好世界" csvString = "\uFEFF" + csvString; // New string after adding UTF-8 Byte Order Mark (BOM)</code></pre><P>&nbsp;</P><P>Hence we can see how hardcoding a byte order can help us in dealing with foreign characters and unique encoding styles.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shayanmajumder_1-1710239236316.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79140i0303D872ADBD76E2/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_1-1710239236316.png" alt="shayanmajumder_1-1710239236316.png" /></span></P><H3 id="toc-hId-331918845">Use of byte markers incase of bidirectional text</H3><P>Certain integration which involve bidirectional texts involving a mix of both Left to Right and Right to Left directional texts this might require the use of byte markers which make it unidirectional. A good example of such kind of integrations is the Hilan interface which involves a mix of both Hebrew and English alphabets and hence viewing the data effectively becomes very difficult.&nbsp;</P><TABLE border="1" width="100%"><TBODY><TR><TD width="20%" height="57px"><STRONG>Direction</STRONG></TD><TD width="20%" height="57px"><STRONG>Unicode Byte Marker</STRONG></TD><TD width="20%" height="57px"><STRONG>Description</STRONG></TD><TD width="20%" height="57px"><STRONG>Preview (Showing all characters )</STRONG></TD><TD width="20%" height="57px"><STRONG>Final Display</STRONG></TD></TR><TR><TD width="20%" height="39px"><SPAN>LTR (Left-to-Right)</SPAN></TD><TD width="20%" height="39px"><STRONG>\u200E</STRONG></TD><TD width="20%" height="39px"><SPAN>This marker signals left-to-right text.</SPAN></TD><TD width="20%" height="39px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_1-1710236259683.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79098iC19296D1B18AB665/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_1-1710236259683.png" alt="shayanmajumder_1-1710236259683.png" /></span></TD><TD width="20%" height="39px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_2-1710236332323.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79100i9BBDED2096BD7A04/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_2-1710236332323.png" alt="shayanmajumder_2-1710236332323.png" /></span></TD></TR><TR><TD width="20%" height="30px">RTL (Right-to-Left)</TD><TD width="20%" height="30px"><STRONG>\u200F</STRONG></TD><TD width="20%" height="30px"><SPAN>This marker signals right-to-left text.</SPAN></TD><TD width="20%" height="30px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_4-1710236904481.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79110iDF96B984CF498AF0/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_4-1710236904481.png" alt="shayanmajumder_4-1710236904481.png" /></span></TD><TD width="20%" height="30px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_11-1710237814440.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79130i5EBD358167672FCA/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_11-1710237814440.png" alt="shayanmajumder_11-1710237814440.png" /></span></TD></TR><TR><TD width="20%" height="57px">Pop Directional Format</TD><TD width="20%" height="57px"><STRONG>\u202C</STRONG></TD><TD width="20%" height="57px"><SPAN>The marker terminates an embedding or overrides control by popping the last direction setting.</SPAN></TD><TD width="20%" height="57px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_0-1710237079477.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79114i6726F2FD41E75FC7/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_0-1710237079477.png" alt="shayanmajumder_0-1710237079477.png" /></span></TD><TD width="20%" height="57px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_1-1710237130026.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79116i29A58528605FDC37/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_1-1710237130026.png" alt="shayanmajumder_1-1710237130026.png" /></span></TD></TR><TR><TD width="20%" height="57px">LRE (Left-to-Right Embedding)</TD><TD width="20%" height="57px"><STRONG>\u202A</STRONG></TD><TD width="20%" height="57px"><SPAN>This marker indicates that the following text should be treated as an embedded left-to-right block.</SPAN></TD><TD width="20%" height="57px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_3-1710237270796.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79119iD1528E688D3A63E3/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_3-1710237270796.png" alt="shayanmajumder_3-1710237270796.png" /></span></TD><TD width="20%" height="57px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_2-1710237238643.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79118iE6318A56D0E1EAC3/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_2-1710237238643.png" alt="shayanmajumder_2-1710237238643.png" /></span></TD></TR><TR><TD width="20%">RLE (Right-to-Left Embedding)</TD><TD width="20%" height="33px"><STRONG>\u202B</STRONG></TD><TD width="20%" height="33px"><SPAN>Use this marker to indicate that the following text should be treated as a right-to-left block.</SPAN></TD><TD width="20%" height="33px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_4-1710237365497.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79120i471E1DFEFE72D9A4/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_4-1710237365497.png" alt="shayanmajumder_4-1710237365497.png" /></span></TD><TD width="20%" height="33px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_5-1710237391888.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79121i37A01790D0081A5E/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_5-1710237391888.png" alt="shayanmajumder_5-1710237391888.png" /></span></TD></TR><TR><TD width="20%" height="32px">Left-to-Right Override</TD><TD width="20%" height="32px"><STRONG>\u202D</STRONG></TD><TD width="20%" height="32px"><SPAN>This marker enforces left-to-right direction for the enclosed text, overriding the default right-to-left direction.</SPAN></TD><TD width="20%" height="32px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_6-1710237504944.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79122iD78F44DF0E0A7608/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_6-1710237504944.png" alt="shayanmajumder_6-1710237504944.png" /></span></TD><TD width="20%" height="32px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_7-1710237533501.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79124iAA857AFF20336F43/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_7-1710237533501.png" alt="shayanmajumder_7-1710237533501.png" /></span></TD></TR><TR><TD width="20%" height="33px">Right-to-Left Override</TD><TD width="20%" height="33px"><STRONG>\u202E</STRONG></TD><TD width="20%" height="33px"><SPAN>This marker enforces right-to-left direction for the enclosed text, overriding the default left-to-right direction.</SPAN></TD><TD width="20%" height="33px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_8-1710237578355.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79126iA4CDE597E6753615/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_8-1710237578355.png" alt="shayanmajumder_8-1710237578355.png" /></span></TD><TD width="20%" height="33px"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shayanmajumder_9-1710237604112.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/79127iCE853454EDD1825F/image-size/medium?v=v2&amp;px=400" role="button" title="shayanmajumder_9-1710237604112.png" alt="shayanmajumder_9-1710237604112.png" /></span></TD></TR></TBODY></TABLE><H3 id="toc-hId-135405340">Conclusion</H3><P><SPAN>While the use of BOM can be beneficial in certain situations, it is not always required or preferred. In some instances, such as HTTP responses and scripting languages, including BOMs can cause unforeseen issues. Therefore, it is crucial to evaluate the specific requirements and compatibility of the systems and tools being utilized before deciding to incorporate a BOM in text files. BOM should also be carefully used incase of fixed width files as it introduces additional special characters which might cause an issue with the interpreting software.</SPAN></P> 2024-04-19T15:47:08.914000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/faq-for-c4c-certificate-renewal/ba-p/13679685 FAQ for C4C Certificate Renewal 2024-04-23T18:12:24.183000+02:00 tales_caron1 https://community.sap.com/t5/user/viewprofilepage/user-id/251072 <P style=" text-align: center; "><FONT color="#800000"><STRONG><U>SAP Passport CA G2</U></STRONG></FONT></P><P><STRONG>R</STRONG><STRONG>enewal of SAP Passport CA G2 certificate common questions:</STRONG></P><OL><LI><STRONG>What is expiring on 14th May 2024 and what will be impacted?</STRONG></LI></OL><P>The Intermediate Certificate of the M-user, which is SAP Passport CA G2 validity, expires on 14th May 2024.</P><P>There is no change on the root and leaf certificates, if you’ve done certificate pinning in any of your integrations/environments using the subject then there is no change or impact as it will work as usual, but the intermediate certificate of that chain is being renewed. Hence, it is mandatory to add the new certificate (SAP Passport CA G2) to your trust list so that your integrations will not break.</P><P>Download the new certificate from the <SPAN><A href="https://me.sap.com/notes/3402581/E" target="_blank" rel="noopener noreferrer"><STRONG>KBA #3402581</STRONG></A></SPAN></P><P>&nbsp;</P><OL><LI><STRONG>M-user certificate has a validity of more than the expiry date of the Intermediate Certificate (SAP Passport CA G2) will this have any impact on our integration?</STRONG></LI></OL><P>There will be no impact on your existing M-user certificate, you can still use it till the expiry, but you need to add the new certificate (SAP Passport CA G2) to your server integration trust list, whereas from the C4C side, the trust store is already added with the new certificate.</P><P>&nbsp;</P><OL><LI><STRONG>We have no direct connection- All our connections are routed through CPI. Do we need to update to update the certificates in Production in this case?</STRONG></LI></OL><P>If your productive tenant is routed through Load Balancer and not Akamai, you need to consider updating the Intermediate certificate into CPI Key Store.</P><P>The SAP Passport CA G2 is already renewed, so you can create a new C4C keypair from the Communication Arrangement and update your CPI.</P><P>&nbsp;</P><OL><LI><STRONG>We have two attached emails for certificate updates, and we are confused about the updates required and their sequencing. In the past also faced several issues over certificates which resulted in business disruptions. We would like to get the following information:</STRONG></LI></OL><P>&nbsp;</P><UL><LI>&nbsp;<STRONG><EM>Which certificates are to be updated? Do we have to download from both notes?</EM></STRONG></LI></UL><P>Passport CA G2 Validity Extension: this renewal is planned in April end. Customer communications have been broadcasted by our Operation Team. Customer needs to update their integration systems and business communications arrangements.</P><P>You can refer to the following KBA article: Invalid Certificate Chain Error When Uploading C4C Certificate into CPI Key Store (<SPAN><A href="https://itsm.services.sap/kb_view.do?sysparm_article=KB0759480" target="_blank" rel="noopener nofollow noreferrer">https://itsm.services.sap/kb_view.do?sysparm_article=KB0759480</A></SPAN>)</P><P>&nbsp;</P><UL><LI>&nbsp;<STRONG><EM>Do we have to update both C4C and CPI?</EM></STRONG></LI></UL><P>Yes, you need to update it before May 14th</P><P>&nbsp;</P><OL><LI><STRONG>We created a service key inside the BTP Integration Suite so that the C4C can log in with the M-Certificate. There is no option to add some certificates to a trust list. </STRONG></LI></OL><P><STRONG>&nbsp;</STRONG><STRONG>That said: We can leave everything as it is, and our communication will not break after the 14th of May. Even if the chain of the M-Cert is not valid anymore, cause the BTP does not care?</STRONG></P><P><STRONG>&nbsp;</STRONG>You do not need to change the current Service Key since the child M-user certificate remains the same.</P><P>The only action required refers to removing from your CPI Trust list the SAP Passport CA G2 (with the validity to May 14th ) and replaced by the new SAP Passport CA G2 which contains the extended validity date.</P><P>&nbsp;</P><OL><LI><STRONG>Do I need to be concerned about the M-User (Mandate)/Tenant certificate due to this renewal as well?</STRONG></LI></OL><P>The M-user is signed by SAP Passport CA G2, however it remains the same. The M-User certificate is updated via SAP Background job which runs 60 days before its expiration.</P><P>It will automatically renew the certificate and triggers the notifications with the subject <EM>'Tenant Certificate has been renewed'.</EM></P><P>Please refer to the blog: <SPAN><A href="https://community.sap.com/t5/crm-and-cx-blogs-by-sap/all-about-tenant-certificate-renewal-in-sap-cloud-for-customer/ba-p/13469059" target="_blank">https://community.sap.com/t5/crm-and-cx-blogs-by-sap/all-about-tenant-certificate-renewal-in-sap-cloud-for-customer/ba-p/13469059</A></SPAN></P><P><STRONG>&nbsp;</STRONG></P><P style=" text-align: center; "><FONT color="#800000"><STRONG><U>Domain Certificate *crm.ondemand.com</U></STRONG></FONT></P><P><STRONG>Renewal of C4C Domain or Tenant certificate common questions:</STRONG></P><OL><LI><STRONG>What is expiring on 30th April 2024 and what will be impacted due to this?</STRONG></LI></OL><P>Domain Certificate (*.crm.ondemand.com) validity is expiring on 30th April 2024. If you have used this certificate anywhere in your integrations previously, then you may need to update the attached one from the <SPAN><A href="https://me.sap.com/notes/3119755" target="_blank" rel="noopener noreferrer"><STRONG>KBA #3119755</STRONG></A></SPAN>. Also, since the chain of the certificate is also being changed, so you need to update entire chains in your trust store.</P><P>Below are the details of the attachment from&nbsp;<STRONG>KBA #3119755</STRONG>.</P><UL><LI><STRONG>Root Certificate:</STRONG> “TrustedRoot.crt” à Subject/CN = “DigiCert Global Root G2”</LI><LI><STRONG>Intermediate Certificate:</STRONG> “DigiCertCA.crt” à Subject/CN = “DigiCert Global G2 TLS RSA SHA256 2020 CA1”</LI><LI><STRONG>Leaf/Domain Certificate:</STRONG> “star_crm_ondemand_com.crt” à Subject/CN = “*.crm.ondemand.com”</LI></UL><P><STRONG>Note:</STRONG> This change is not applicable if your tenant is Akamai enabled, (To check if your tenant is Akamai ION/IPA enabled or not, Please refer the <SPAN><A href="https://me.sap.com/notes/3119733" target="_blank" rel="noopener noreferrer"><STRONG>KBA #3119733</STRONG></A></SPAN> under the Resolution section).</P><P>&nbsp;</P><OL><LI><STRONG>Domain certificates as per communication will expire on April 30th and change will be executed between April 26th and April 28th for prod. So when do we have to update the certificates from our side?</STRONG></LI></OL><P>It will be renewed on the announced date as per the communication email and this will done by SAP, If you are using this certificate in your integrations, then you may need to download and update it accordingly.</P><UL><LI><STRONG><EM>Does that mean we have to upload before this date?</EM></STRONG></LI></UL><P>Yes, you can upload and add the new certificate in your trust stores before, but that would be effective from the date we renew it at the backend, so it is good to do it before but still, you can do it after the above dates. In-case you are Akamai-enabled customer, then you don't need to do anything.</P><P>You can download the new certificate attached in the following KBA which I created to elucidate the procedure as well as the date details: <SPAN><A href="https://launchpad.support.sap.com/#/notes/3119755" target="_blank" rel="noopener noreferrer">https://launchpad.support.sap.com/#/notes/3119755</A></SPAN></P><P>Please note: this <U>change</U><U> </U><U>does not affect</U><U> </U><U>customers using AKAMAI</U></P><P>&nbsp;</P><OL><LI><STRONG>Shall we update before 26th April, between 26th and 28th, or between 28th to 30th April?</STRONG></LI></OL><P>This certificate *.crm.ondemand.com Domain Certificate Renewal at Origin end' says Change will be executed from April 12th 18:00 hrs UTC to April 13th, 2024, 11:00 hrs. UTC for Test Systems.</P><P>&nbsp;</P> 2024-04-23T18:12:24.183000+02:00 https://community.sap.com/t5/technology-blogs-by-members/general-splitter-in-ci-namespace-prefix-problem/ba-p/13679534 General Splitter in CI - Namespace Prefix Problem 2024-04-26T13:52:11.421000+02:00 monikasch https://community.sap.com/t5/user/viewprofilepage/user-id/1389082 <P>Hello together,</P><P>In Cloud Integration, the General Splitter can be used in Integration Flows to split a payload in multiple segments and process each segment individually. However, if global namespaces are involved, the General Splitter might not work as expected. If not configured correctly, it behaves as if the payload was empty which means that the following steps are not executed.</P><P>In our example Integration Flow, we fetch data from a webservice using an HTTP adapter and split the response message before calling a Local Integration Flow.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henningb23_0-1714027042754.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/101553i1F72716B12A1CD1F/image-size/medium?v=v2&amp;px=400" role="button" title="henningb23_0-1714027042754.png" alt="henningb23_0-1714027042754.png" /></span></P><P>The response message looks as follows. It contains multiple <EM>entry</EM> elements which should be processed individually.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henningb23_0-1714028311090.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/101607iE6909E0033BE50F7/image-size/large?v=v2&amp;px=999" role="button" title="henningb23_0-1714028311090.png" alt="henningb23_0-1714028311090.png" /></span></P><P>When using the XPath expression <EM>//entry</EM> in the General Splitter, the splitting step does not produce any output, so the following steps in the Integration Flow are never reached.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henningb23_1-1714028522913.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/101609iBBFD2AA64561DF9A/image-size/medium?v=v2&amp;px=400" role="button" title="henningb23_1-1714028522913.png" alt="henningb23_1-1714028522913.png" /></span></P><P>We show three approaches to get around this problem.</P><H2 id="toc-hId-992735040">1. Removing Namespaces</H2><P>We remove the namespace information from the XML file by introducing an XSLT mapping step.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henningb23_2-1714029203533.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/101618iE86137CAA266BE58/image-size/medium?v=v2&amp;px=400" role="button" title="henningb23_2-1714029203533.png" alt="henningb23_2-1714029203533.png" /></span></P><P>In our example, we use the following XSLT mapping which also simplifies the payload a bit.</P><pre class="lia-code-sample language-abap"><code>&lt;!-- XSL stylesheet for removing namespace prefixes and declarations. The stylesheet also removes XML elements that are not needed for the following steps. --&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:a="http://www.w3.org/2005/Atom" exclude-result-prefixes="m d a"&gt; &lt;xsl:template match="/"&gt; &lt;feed&gt; &lt;xsl:apply-templates select="//a:entry" /&gt; &lt;/feed&gt; &lt;/xsl:template&gt; &lt;xsl:template match="a:entry"&gt; &lt;entry&gt; &lt;xsl:apply-templates select="a:content" /&gt; &lt;/entry&gt; &lt;/xsl:template&gt; &lt;xsl:template match="a:content"&gt; &lt;content&gt; &lt;xsl:apply-templates select="@*|node()" /&gt; &lt;/content&gt; &lt;/xsl:template&gt; &lt;!-- templates to remove namespace prefix --&gt; &lt;xsl:template match="d:*"&gt; &lt;xsl:element name="{local-name()}"&gt; &lt;!-- &lt;xsl:apply-templates select="@*|node()"/&gt; --&gt; &lt;xsl:apply-templates select="node()" /&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;xsl:template match="m:*"&gt; &lt;xsl:element name="{local-name()}"&gt; &lt;xsl:apply-templates select="@*|node()" /&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt;</code></pre><P>After adding the XSLT mapping step the General Splitter works as expected when using <EM>//entry</EM> XPath expression.</P><H2 id="toc-hId-796221535">2. Adding Namespace Information to the XPath Expression</H2><P>The probably most straightforward solution is to add namespace information to the XPath expression. Since the XML file's root element <EM>feed</EM> belongs to the namespace <A href="http://www.w3.org/2005/Atom," target="_blank" rel="nofollow noopener noreferrer"><EM>http://www.w3.org/2005/Atom</EM>,</A> all the other elements - including <EM>entry</EM> - also belong to this namespace as long as no other namespace is specified for them. Therefore, we add a namespace prefix <EM>atom</EM> and the namespace URL to the XPath expression as follows:</P><P><EM>//atom:entry xmlns:atom="<A href="http://www.w3.org/2005/Atom," target="_blank" rel="nofollow noopener noreferrer">http://www.w3.org/2005/Atom</A>"</EM></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henningb23_3-1714030451314.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/101630i3FCF2C8D6C638D05/image-size/medium?v=v2&amp;px=400" role="button" title="henningb23_3-1714030451314.png" alt="henningb23_3-1714030451314.png" /></span></P><H2 id="toc-hId-599708030">3. Adding Namespace Information Globally</H2><P>It is also possible to add the namespace declaration globally in the Integration Flow's Runtime Configuration. This is the best solution if a namespace is used at multiple places.</P><P>In our example, we enter <EM>xmlns:atom=<A href="http://www.w3.org/2005/Atom," target="_blank" rel="nofollow noopener noreferrer">http://www.w3.org/2005/Atom</A></EM> as Namespace Mapping.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henningb23_5-1714031082527.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/101635iA4184056113FB981/image-size/medium?v=v2&amp;px=400" role="button" title="henningb23_5-1714031082527.png" alt="henningb23_5-1714031082527.png" /></span></P><P>After that you can use the name of the namespace mapping in the General Splitter.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henningb23_6-1714031148021.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/101639iBF792A76E0AEC30B/image-size/medium?v=v2&amp;px=400" role="button" title="henningb23_6-1714031148021.png" alt="henningb23_6-1714031148021.png" /></span></P><H2 id="toc-hId-403194525">Conclusion</H2><P>We showed three solutions to get around problems when using the General Splitter for dividing payloads with a global namespace. We hope this information can help you if you are struggling with the same problem.</P><P>Further information about this topic can be found on the SAP Help Portal: <A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/general-and-iterating-splitter-examples" target="_blank" rel="noopener noreferrer">General and Iterating Splitter Examples</A>&nbsp;</P><P>We are open for improvements and questions.</P><P>Monika and Henning from Integration Team<BR /><FONT color="#000000"><STRONG>RealCore Group</STRONG></FONT></P> 2024-04-26T13:52:11.421000+02:00 https://community.sap.com/t5/technology-blogs-by-members/how-to-leverage-sap-ci-and-apim-for-hyperlink-with-query-parameters-as/ba-p/13678456 How to Leverage SAP CI and APIM for Hyperlink with Query Parameters as Input and no Authentication 2024-05-03T08:29:01.710000+02:00 JSakth https://community.sap.com/t5/user/viewprofilepage/user-id/1440301 <H3 id="toc-hId-1121787071">Introduction:</H3><P>This blog explains a method to transform the SAP Cloud Integration(Integration Suite) iFlow HTTP URL into a clickable hyperlink through SAP APIM.</P><P>P.S: This marks my debut in the world of blogging!</P><H3 id="toc-hId-925273566">Requirement:</H3><P><SPAN>Imagine a scenario where a client procurement platform generates a link containing input data as a query parameter, but it lacks proper authorization. Our objective is to create a hyperlink that exposes the SAP CI iFlow URL. This hyperlink would send a response after forwarding the request to the target system. However, we are facing below challenges in this process.</SPAN></P><UL><LI>The URL query parameter is not encoded, potentially causing errors when directly used in the SAP CI iFlow URL.</LI><LI>Lack of authentication poses a significant challenge, as SAP CI requires at least basic authentication.&nbsp;</LI></UL><H3 id="toc-hId-728760061">Solution:</H3><P><SPAN>SAP APIM acts as an intermediary layer between the client procurement buying platform and SAP CI iFlow addressing the challenges mentioned above.&nbsp;</SPAN>Here's how it works:</P><UL><LI><STRONG>Encoding:</STRONG> SAP APIM ensures that query parameters are properly encoded before transmission to the SAP CI iFlow.</LI><LI><STRONG>Authorization Handling:</STRONG> By leveraging SAP APIM, authorization mechanisms can be implemented in APIM. The APIM also ensures that only authorized requests are passed on to SAP CI iFlow using IP whitelisting hence enhancing security and compliance.</LI></UL><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iflow.png" style="width: 943px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104440iC3C68EDB8D11448B/image-size/large?v=v2&amp;px=999" role="button" title="iflow.png" alt="iflow.png" /></span></SPAN></P><P>&nbsp;</P><H4 id="toc-hId-661329275"><SPAN>Setup in SAP API Management:</SPAN></H4><OL><LI>For initial setup including creating the API Provider, API Proxy, and configuring the iFlow URL along with authentication we can refer the instructions outlined in this <A href="https://community.sap.com/t5/technology-blogs-by-members/connecting-and-exposing-api-endpoint-from-sap-cloud-integration-part-2/ba-p/13581001" target="_self">blog</A>.</LI><LI>Based on this&nbsp;<A href="https://community.sap.com/t5/technology-blogs-by-members/steps-to-manage-multiple-ip-address-ranges-in-sap-api-management-using-kvm/ba-p/13572193" target="_self">blog</A>&nbsp;we can implement the<SPAN>&nbsp;IP whitelisting to exclusively permit client IPs to pass through the APIM thereby reinforcing security measures.</SPAN></LI></OL><H4 id="toc-hId-464815770"><SPAN>Integration Flow Design in SAP CI:</SPAN></H4><P><SPAN>Let's begin by examining the sample URL generated by the client procurement platform.</SPAN></P><P><SPAN>https://<STRONG>SAP_APIM_URL</STRONG>?purchasingUnit=123&amp;AccountAssignment=Test23&amp;FieldValues={2=546,3=6290459,7=X02,}</SPAN></P><P>In the URL above we will notice that the input data is contained within query parameters. Below we will explore how SAP CI iFlow transforms these query parameters into the desired XML format.</P><H5 id="toc-hId-397384984">Sample CI iFlow:</H5><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="sampleiflow.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/103848i40958A6C080BB73F/image-size/large?v=v2&amp;px=999" role="button" title="sampleiflow.png" alt="sampleiflow.png" /></span></P><H5 id="toc-hId-200871479">1. Configure HTTP Sender:</H5><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JSakth_0-1714474984776.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/103854iDAF169B1E5F78FC6/image-size/medium?v=v2&amp;px=400" role="button" title="JSakth_0-1714474984776.png" alt="JSakth_0-1714474984776.png" /></span></P><P>Set up the HTTPS sender adapter with the Address field starting with '/'. Once the iFlow is deployed we will obtain the iFlow endpoint URL which will then be configured in SAP APIM.</P><H5 id="toc-hId-4357974">2. Groovy to Get Query Params :</H5><P>With the below Groovy script (based on this&nbsp;<A href="https://community.sap.com/t5/technology-q-a/handle-multiple-input-request-parameter-in-cpi/qaq-p/12468481/comment-id/4670830#M4670830" target="_self">solution</A>&nbsp;) each query parameter is being stored in a header.</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>import com.sap.gateway.ip.core.customdev.util.Message import java.util.HashMap import java.net.URLDecoder def Message processData(Message message) { def params = [:] (message.getHeaders().CamelHttpQuery =~ /(\w+)=?([^&amp;]+)?/)[0..-1].each { params[it[1]] = URLDecoder.decode(it[2], "UTF-8") } message.setHeader("purchasingUnit", params.purchasingUnit) message.setHeader("AccountAssignment", params.AccountAssignment) message.setHeader("FieldValues", params.FieldValues) return message }</code></pre><P>&nbsp;</P><H5 id="toc-hId--192155531">&nbsp;</H5><H5 id="toc-hId--388669036">3. Groovy to Get Key values:</H5><P>The below Groovy script is utilized to extract and store each value corresponding to specific keys from the 'FieldValues' query parameter, which contains a key-value map. For example, keys like '2' correspond to 'CostCenter', '3' corresponds to 'Account' and so forth.</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>import com.sap.gateway.ip.core.customdev.util.Message; def Message processData(Message message) { def headerString = message.getHeaders().get("FieldValues"); if (headerString != null &amp;&amp; headerString instanceof String) { def keyValuePairs = headerString.findAll(/\d+=\w+/); keyValuePairs.each { pair -&gt; def keyValue = pair.tokenize("="); if (keyValue.size() == 2) { def key = keyValue[0].trim(); def value = keyValue[1].trim(); message.setProperty("key_" + key, value); } } } return message; }</code></pre><P>&nbsp;</P><P>This script will store the values in a property, as illustrated in the screenshot below.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JSakth_1-1714476486805.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/103876i703C23D707EEC410/image-size/medium?v=v2&amp;px=400" role="button" title="JSakth_1-1714476486805.png" alt="JSakth_1-1714476486805.png" /></span></P><P>&nbsp;</P><H5 id="toc-hId--1505385362">4. Mapping to target XML:</H5><P>Creating the output XML is straightforward we will match the headers and properties from our previous Groovy scripts with their respective target fields.</P><P>Here are examples of how we have mapped the headers and properties to their corresponding target fields.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="JSakth_0-1714546521262.png" style="width: 958px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104311i141BEE5C35C93D27/image-size/large?v=v2&amp;px=999" role="button" title="JSakth_0-1714546521262.png" alt="JSakth_0-1714546521262.png" /></span><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2024-05-01 122547.png" style="width: 964px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104314i83A39BA175749998/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-05-01 122547.png" alt="Screenshot 2024-05-01 122547.png" /></span></P><H5 id="toc-hId--1701898867">5. Groovy Script to send response:</H5><P>After sending the XML to the target system we will receive a response indicating either success or failure along with an error message if applicable. The following script will generate a basic HTML response based on the received response.</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>import com.sap.gateway.ip.core.customdev.util.Message import groovy.xml.* def Message processData(Message message) { def body = message.getBody(java.lang.String) as String def xmlNode = new XmlSlurper().parseText(body) def headers = message.getHeaders() def returnCode = xmlNode.ReturnCode.text() if (returnCode == "success") { // Set success response in HTML format def successMessage = headers['FieldValues'] def successBody = "&lt;html&gt;&lt;body&gt;&lt;h1&gt;Account Validation:&lt;/h1&gt;&lt;h2&gt;Account validation successful for combination $successMessage&lt;/h2&gt;&lt;/body&gt;&lt;/html&gt;" message.setBody(successBody.getBytes("UTF-8")) // Set content type to text/html message.setHeader("Content-Type", "text/html") } else { // Set error response with ErrorMessage in HTML format def errorMessage = xmlNode.ErrorMessage.text() def errorBody = "&lt;html&gt;&lt;body&gt;&lt;h1&gt;Account Validation:&lt;/h1&gt;&lt;h2&gt;Error: $errorMessage&lt;/h2&gt;&lt;/body&gt;&lt;/html&gt;" message.setBody(errorBody.getBytes("UTF-8")) // Set content type to text/html message.setHeader("Content-Type", "text/html") } return message }</code></pre><P>&nbsp;</P><H4 id="toc-hId--1605009365">&nbsp;</H4><H4 id="toc-hId--1801522870">Testing:</H4><P>Now, let's test some sample scenarios.</P><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><H5 id="toc-hId-2003527914">Case 1: Success Scenario</H5><P>In this scenario, when the call is made to the URL from the client's IP address and the target response is successful the user will receive a similar response as shown in the screenshot below.</P><P>&nbsp;</P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="JSakth_0-1714547895505.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104324i7FD74EEAE9A6EB34/image-size/large?v=v2&amp;px=999" role="button" title="JSakth_0-1714547895505.png" alt="JSakth_0-1714547895505.png" /></span></DIV><H5 id="toc-hId-1807014409"><SPAN>Case 2: Error Scenario:</SPAN></H5><P>In this scenario, when the call is made to the URL from the client's IP address and the target response is failure/error the user will receive a similar response with error massage as shown in the screenshot below.</P><H5 id="toc-hId-1610500904"><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="JSakth_1-1714548373029.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104325i833B73CBF1EFDA6A/image-size/large?v=v2&amp;px=999" role="button" title="JSakth_1-1714548373029.png" alt="JSakth_1-1714548373029.png" /></span><SPAN>Case 3: Invalid IP:&nbsp;</SPAN></H5><P>In this scenario, if the request is made to the URL from a non-client IP address the error displayed below will appear. The error is thrown at the SAP APIM layer itself thereby the request is not sent to SAP CI iFlow.</P><H5 id="toc-hId-1413987399"><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="JSakth_2-1714549177887.png" style="width: 995px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104328iDBE45B1406874078/image-size/large?v=v2&amp;px=999" role="button" title="JSakth_2-1714549177887.png" alt="JSakth_2-1714549177887.png" /></span></H5><DIV class="">&nbsp;</DIV><DIV class=""><STRONG>Conclusion:</STRONG><SPAN> This blog explains the process of transforming a SAP CI iFlow URL into a clickable hyperlink(the legacy sender system lacks to provide any authentication) while extracting input data from query parameters and constructing the target XML. By leveraging the concepts outlined in this blog we can extend our capabilities to execute more complex integrations using similar methodologies.</SPAN><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV><P>&nbsp;</P> 2024-05-03T08:29:01.710000+02:00 https://community.sap.com/t5/technology-blogs-by-members/sap-pipeline-concept-and-b2b-tpm-testing/ba-p/13691706 SAP Pipeline Concept and B2B TPM testing 2024-05-06T07:30:00.023000+02:00 MichalKrawczyk https://community.sap.com/t5/user/viewprofilepage/user-id/45785 <H2 id="toc-hId-994345585">Abstract</H2><P>With the introduction of the <A href="https://help.sap.com/docs/help/90c8ad90cb684ee5979856093efe7462/6e527fb074834af2be2546c6e7e2fa5f.html" target="_self" rel="noopener noreferrer">SAP Pipeline Concept&nbsp;</A>we now have a second large use case apart from B2B-TPM which allows processing different types of messages with a set of predefined generic iflows. This blog will show a few ways how automated testing of such scenarios can be set up of the box with Int4 Shield - SAP Integration Suite testing platform and how SAP Integration Suite customers already use it for such scenarios.</P><H2 id="toc-hId-797832080"><BR />SAP Pipeline Concept and B2B TPM - multiple iflows</H2><P>In the pipeline concept, each step corresponds to an integration flow (generic integration flows and scenario-specific integration flows). The generic integration flows are used across all integration scenarios and must only be deployed once while scenario-specific integration flows handle the scenario-specific message conversions and mappings.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="01_Pipelines (1).png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105886i04E8F60681E158D1/image-size/large?v=v2&amp;px=999" role="button" title="01_Pipelines (1).png" alt="01_Pipelines (1).png" /></span></P><P><FONT size="2">File Source: <A href="https://community.sap.com/t5/technology-blogs-by-sap/introducing-the-new-pipeline-concept-in-cloud-integration/ba-p/13639651" target="_blank">https://community.sap.com/t5/technology-blogs-by-sap/introducing-the-new-pipeline-concept-in-cloud-integration/ba-p/13639651</A></FONT></P><P>Similarly the B2B-TPM the exchange is divided into sender communication iflows, interchange processing and receiver iflows.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tpm.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105887i379426ADF6919A86/image-size/large?v=v2&amp;px=999" role="button" title="tpm.png" alt="tpm.png" /></span></P><P><FONT size="2">File source: <A href="https://community.sap.com/t5/technology-blogs-by-sap/use-tpm-ia-ci-to-efficiently-manage-and-run-complex-b2b-transactions/ba-p/13565068" target="_blank">https://community.sap.com/t5/technology-blogs-by-sap/use-tpm-ia-ci-to-efficiently-manage-and-run-complex-b2b-transactions/ba-p/13565068</A></FONT></P><P>Cloud integration is very flexible in terms of modeling and running your integration scenarios allowing the design of a rich variety of integration patterns on the other hand for some types of scenarios we may want to use a more "formal" way or processing and this is there SAP Pipeline Concept and B2B-TPM scenarios come in handy with some of it's common advantages:<BR /><BR />a) Provide commonly used restart capabilities<BR />b) Simplifies operations by separating errors into different generic queues<BR />c) Require lower number of JMS queues to take into account the resource limits<BR />d) Simplify monitoring operations<BR />e) Allow reusability of artifacts across multiple flows by using generic (Pipeline or TPM) iflow concept</P><H2 id="toc-hId-601318575">SAP Pipeline Concept and B2B TPM - testing</H2><P>Since those two frameworks are going to be used more and more and they involve several iflows to be tested<BR />is there any way to automate the testing of such integration processes? With Int4 Shield - SAP Integration Suite testing platform, there out of the box we have several ways to implement automated testing of the SAP Pipeline Concept and B2B TPM. Let me explain, how&nbsp;they work.</P><H3 id="toc-hId-533887789">Step 1</H3><P>In both SAP Pipeline Concept and B2B TPM we're working with multiple iflows so we may want to inject the test messages into a specific iflow. This can be the first iflows but does not have to be as we may want to skip testing the initial iflow in some cases.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inject_2.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105888iB8F50A54085F4C96/image-size/large?v=v2&amp;px=999" role="button" title="inject_2.png" alt="inject_2.png" /></span></P><P><FONT size="2">Figure - Int4 Shield inject test message options&nbsp;</FONT></P><H3 id="toc-hId-337374284">Step 2</H3><P>Now we need to decide what do we want to test. What are the options? Basically two:</P><P>a) we can either test the whole framework (SAP Pipeline Concept and B2B TPM ) from start to finish</P><P>b) we may want to test specific iflows of the whole framework (SAP Pipeline Concept and B2B TPM)</P><P>For this purpose Int4 Shield automatically enables Trace monitoring level on tested iFlows to be able to introspect processing inside of these steps.<BR />Thanks to this Int4 Shield can validate payload content at any single execution block of the processing steps.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="both_3.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105889i10B0D7466D49B7F7/image-size/large?v=v2&amp;px=999" role="button" title="both_3.png" alt="both_3.png" /></span><BR /><FONT size="2">Figure - Int4 Shield inject test message and trace start with validation options&nbsp;</FONT></P><H3 id="toc-hId-140860779">Step 3</H3><P><STRONG>Scenario 1 (single automation object)</STRONG> - for simple black box testing, Int4 Shield injects the message in the initial step and awaits for logs and payload to arrive at the final processing step, capturing the output payload, as it would be sent to a target system. Single test case and single <A href="https://int4support.atlassian.net/wiki/spaces/IUM/pages/2062843993/Automation+Objects" target="_self" rel="nofollow noopener noreferrer">automation object</A> is sufficient for test and validation.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="single_4.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105890i9FCFA739C4957037/image-size/large?v=v2&amp;px=999" role="button" title="single_4.png" alt="single_4.png" /></span></P><P><FONT size="2">Figure - Int4 Shield validation option with a single automation object&nbsp;</FONT></P><P><STRONG>Scenario 2 (combination of automation objects - API workflows testing)</STRONG> - thorough testing is made possible with more test cases that execute more validation steps. In a typical scenario there is separate validation of Step 2 - to check if payload input was properly processed by Step 1 logic, and for Step 3 - to validate the output payload after mapping is correct and routed to the expected channel.<BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="double_5.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105891i352C96B56E571214/image-size/large?v=v2&amp;px=999" role="button" title="double_5.png" alt="double_5.png" /></span><BR /><FONT size="2">Figure - Int4 Shield validation option with a a combination of automation objects - API workflow testing&nbsp;</FONT><BR /><BR /></P><H3 id="toc-hId--55652726">SAP Pipeline Concept and B2B TPM - framework support</H3><P>Int4 Shied testing concept for SAP Pipeline Concept and B2B TPM supports:</P><P>a) Multiple adapter types : SFTP, JMS, HTTP, IDOC, ProcessDirect, SOAP<BR />b) Enabling unit testing of specific flow components<BR />c) Testing business flows with Inputs and Outputs from different iFlows<BR />d) Test complete SAP Pipeline Concept and B2B TPM execution with one test case<BR />e) Capture and test intermediate results from specific iFlow steps<BR />f) Test complete SAP Pipeline Concept and B2B TPM execution, validating document flow through the iFlows<BR />g) Massive and automated test case creation<BR />h) Test case loader - mass load of test files<BR />i) Robotic crawler - automatic capture of historical data from another integration platform<BR />j) Test scenario builder - linking multiple test cases into test scenarios automatically based on message content (e.g. document numbers)</P><H2 id="toc-hId--381248950">Additional resources</H2><P><A href="https://community.sap.com/t5/technology-blogs-by-members/b2b-tpm-on-sap-btp-integration-suite-migration-sap-po-boomi-edi-providers/ba-p/13578709" target="_self">B2B/TPM on SAP BTP Integration Suite migration (SAP PO, Boomi, EDI Providers and home-grown apps)</A></P><P><A href="https://community.sap.com/t5/technology-blogs-by-members/int4-suite-for-sap-btp-integration-suite-testing-fully-integrated-with-sap/ba-p/13554430" target="_self">Int4 Suite for SAP BTP Integration Suite testing fully integrated with SAP Cloud ALM</A>&nbsp;</P><P><A href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/4-big-waves-for-api-led-strategies-and-sap-btp-integration-suite-explosive/ba-p/13629867" target="_self">4 big waves for API led strategies and SAP BTP Integration Suite explosive growth</A>&nbsp;</P><P><A href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/there-is-no-ai-without-api-integration-is-the-backbone-of-digital/ba-p/13626331" target="_self">There is no AI without API - Integration is the backbone of digital transformations</A>&nbsp;</P> 2024-05-06T07:30:00.023000+02:00 https://community.sap.com/t5/kolkata-blog-posts/sap-inside-track-kolkata-2024-a-beacon-for-future-sap/ba-p/13693074 SAP Inside Track Kolkata 2024: A Beacon for Future SAP 2024-05-07T14:01:56.525000+02:00 Kamallica https://community.sap.com/t5/user/viewprofilepage/user-id/1418362 <P>The year 2024 brought with it a groundbreaking event in the world of SAP: SAP Inside Track Kolkata 2024. This event served as a pivotal moment, not only shining a spotlight on the future of SAP careers but also delving into the critical realm of cloud integration. One of the all esteemed speakers Mr. Rajsekhar Venkatachalaiah, whose presentation on cloud integration within SAP SuccessFactors left a lasting impression for all the participants from SAP HR background.</P><P><STRONG>The Significance of Cloud Integration</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kamallica_0-1715023121912.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/106484i6CA9B7DFECAC4AB2/image-size/medium?v=v2&amp;px=400" role="button" title="Kamallica_0-1715023121912.png" alt="Kamallica_0-1715023121912.png" /></span></P><P>Cloud integration has emerged as a cornerstone of modern business operations. Its importance cannot be overstated in today's technology landscape, where connectivity, scalability, and accessibility reign supreme. Integrating cloud services enables organizations to revolutionize their operations in several key ways:</P><OL><LI><STRONG>Seamless Connectivity: </STRONG>Facilitates smooth data exchange between systems, enhancing collaboration and efficiency.</LI><LI><STRONG>Scalability: </STRONG>Enables organizations to adjust resources dynamically, ensuring optimal performance in changing environments.</LI></OL><UL><LI><STRONG>Accessibility: </STRONG>Provides flexible access to business applications and data from anywhere, improving productivity.</LI></UL><OL><LI><STRONG>Cost Reduction: </STRONG>Lowers infrastructure costs and complexities, freeing up resources for innovation and growth.</LI></OL><P><STRONG>&nbsp;</STRONG></P><P><STRONG>Cloud Integration in SAP SuccessFactors: Insights from Mr. Rajsekhar Venkatachalaiah</STRONG></P><P>Mr. Rajsekhar Venkatachalaiah's presentation at SAP Inside Track Kolkata 2024 delved into the specific benefits of cloud integration within SAP SuccessFactors, a leading HR management system. Through insightful business scenario-based discussions and live demonstrations, Mr. Venkatachalaiah illuminated the transformative potential of cloud integration in SAP SuccessFactors through with Embedded Foundation Object (EFO) solutions. These solutions offer an organized framework for developing scalable and personalized HR solutions within the SAP ecosystem. With the pre-configured HR functions and best practices that EFOs provide, businesses may expedite HR procedures and guarantee uniformity amongst various SAP SuccessFactors modules and apps. Organizations can expedite the following arrears inside an organization by utilizing EFOs:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kamallica_1-1715022070083.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/106476i039CCC2DB95B4821/image-size/medium?v=v2&amp;px=400" role="button" title="Kamallica_1-1715022070083.png" alt="Kamallica_1-1715022070083.png" /></span></P><OL><LI><STRONG>Optimizing HR Operations: </STRONG>Streamline talent management, payroll processing, and performance evaluation processes, enhancing efficiency.</LI><LI><STRONG>Enhancing Employee Experience: </STRONG>Deliver personalized experiences through self-service portals, training resources, and performance feedback, boosting engagement and productivity.</LI></OL><UL><LI><STRONG>Enabling Data-Driven Insights: </STRONG>Aggregate and analyze HR data to derive actionable insights, optimize workforce planning, and drive strategic initiatives<STRONG>.</STRONG></LI></UL><P>&nbsp;</P><P>&nbsp;<STRONG>Introducing Joule: A Conventional Supportive Pattern</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kamallica_2-1715022070094.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/106477i1F9EC06750939991/image-size/medium?v=v2&amp;px=400" role="button" title="Kamallica_2-1715022070094.png" alt="Kamallica_2-1715022070094.png" /></span></P><P>As part of his presentation, Mr. Rajsekhar Venkatachalaiah introduced Joule, a revolutionary tool designed to enhance user experience within SAP SuccessFactors. Joule embodies three conventional supportive patterns:</P><P>&nbsp;</P><OL><LI><STRONG>Navigation Assistance: </STRONG>Joule guides users through SAP SuccessFactors' features efficiently.</LI><LI><STRONG>Task Optimization: </STRONG>It offers step-by-step guidance to streamline task completion and boost productivity.</LI></OL><UL><LI><STRONG>Information Retrieval: </STRONG>It facilitates quick access to relevant information, aiding faster decision-making by minimizing search time.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kamallica_3-1715022070125.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/106479i6975C8CE0D2023B3/image-size/medium?v=v2&amp;px=400" role="button" title="Kamallica_3-1715022070125.png" alt="Kamallica_3-1715022070125.png" /></span></P><P>In Conclusion, SAP Inside Track Kolkata 2024 was not just an event; it was a catalyst for change, illuminating the path towards a future where SAP careers thrive and cloud integration revolutionizes business operations. Through insightful presentations like Mr. Rajsekhar Venkatachalaiah's, attendees gained valuable insights into the transformative potential of cloud integration in SAP SuccessFactors and the innovative tools shaping the future of user experience.</P><P>&nbsp;</P><P><a href="https://community.sap.com/t5/user/viewprofilepage/user-id/127440">@DataTherapist</a>&nbsp;</P><P><a href="https://community.sap.com/t5/c-khhcw49343/SAP+Inside+Track/pd-p/72472722867005232775920452375500" class="lia-product-mention" data-product="263-1">SAP Inside Track</a>&nbsp;</P><P><a href="https://community.sap.com/t5/c-khhcw49343/SAP+SuccessFactors+platform/pd-p/73555000100800000775" class="lia-product-mention" data-product="171-1">SAP SuccessFactors platform</a>&nbsp;</P><DIV class=""><DIV class=""><SPAN><BR /></SPAN><SPAN><BR /></SPAN><SPAN><BR /></SPAN><SPAN><BR /></SPAN><SPAN><BR /></SPAN></DIV></DIV> 2024-05-07T14:01:56.525000+02:00 https://community.sap.com/t5/technology-blogs-by-members/how-to-build-soap-service-in-sap-cloud-integration-part-2/ba-p/13691514 How to build SOAP service in SAP Cloud Integration, Part 2 2024-05-08T17:44:34.750000+02:00 jirifridrich https://community.sap.com/t5/user/viewprofilepage/user-id/146600 <H4 id="toc-hId-1252509130">SOAP request body</H4><P>We need to call the SOAP service with some input data. In our case it is the invoice id, hence we need to send an http POST request with an XML body, which will contain this invoice id. But what will be the format of that body?</P><P>There are several ways how to create a sample XML body for a SOAP service. It will be always based on the WSDL, which we generated to construct the SOAP sender. We did that with the help of ChatGPT, so why not to ask there? The request to ChatGPT can be as simple as:</P><P><SPAN>'</SPAN><SPAN>Create sample SOAP body, used as the POST call against this WSDL</SPAN><SPAN>' and paste the WSDL from <A href="https://community.sap.com/t5/technology-blogs-by-members/how-to-build-soap-service-in-sap-cloud-integration/ba-p/13669947" target="_blank">previous blog post.</A></SPAN></P><P>We will get a sample code, which we can just copy, as indicated. I am also attaching the code to this blog post.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jirifridrich_0-1714852007252.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105841iEA1FD664C72613D8/image-size/medium?v=v2&amp;px=400" role="button" title="jirifridrich_0-1714852007252.png" alt="jirifridrich_0-1714852007252.png" /></span></P><H4 id="toc-hId-1055995625"><STRONG>Call SOAP endpoint from Postman</STRONG></H4><P>To call our endpoint from Postman, we will need</P><UL><LI>URL of our SOAP service iflow</LI><LI>credentials</LI><LI>body - paste the code provided by ChatGPT</LI></UL><P>We send it as POST request and we should get the hard-coded output values from our iflow.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jirifridrich_1-1714852007255.png" style="width: 561px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105843iFB1973A0D429C96F/image-dimensions/561x237?v=v2" width="561" height="237" role="button" title="jirifridrich_1-1714852007255.png" alt="jirifridrich_1-1714852007255.png" /></span></P><H4 id="toc-hId-859482120"><STRONG>Call SOAP endpoint from SCI</STRONG></H4><P><SPAN>For this scenario we create a simple iflow starting with Timer, by default set to 'Run Once', which means the event will be triggered once we deploy the iflow.</SPAN></P><P>Another component is a Content modifier, where we just paste our XML body content into the Body section.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jirifridrich_2-1714852007257.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105842iDCB0DBE47B605117/image-size/medium?v=v2&amp;px=400" role="button" title="jirifridrich_2-1714852007257.png" alt="jirifridrich_2-1714852007257.png" /></span></P><P>Another component is Request Reply, which we connect to Receiver component using SOAP adapter (type SOAP 1.x). Our iflow could look like this now:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jirifridrich_3-1714852007258.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105844iB3548D7451C5C9BB/image-size/medium?v=v2&amp;px=400" role="button" title="jirifridrich_3-1714852007258.png" alt="jirifridrich_3-1714852007258.png" /></span></P><P>Double click on the dashed-line SOAP adapter and configure it as depicted on the screenshot.</P><UL><LI>Address - fill the URL of our SOAP Sender endpoint (see previous blog post)</LI><LI>URL to WSDL - select our WSDL (again from previous blog post) saved at your desktop</LI><LI>Service, Endpoint, Operation Name gets filled automatically from the WSDL.</LI><LI>Authentication - up to you, I chose Basic</LI><LI>Credential Name - alias of your basic credentials, saved in Security Material in SCI. These credentials have to be first created as Service Key within the SAP BTP Cockpit. If in doubts how to achieve that, please follow the documentation:&nbsp;<A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/creating-service-instance-and-service-key-for-inbound-authentication" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/cloud-integration/sap-cloud-integration/creating-service-instance-and-service-key-for-inbound-authentication</A></LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jirifridrich_4-1714852007259.png" style="width: 486px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105846i7479A4F0E1F22DA6/image-dimensions/486x272?v=v2" width="486" height="272" role="button" title="jirifridrich_4-1714852007259.png" alt="jirifridrich_4-1714852007259.png" /></span></P><P><SPAN>Now save and deploy the iflow. It will end up in error:&nbsp;</SPAN><I>The PayLoad elements cannot fit with the message parts of the BindingOperation. Please check the BindingOperation and PayLoadMessage.</I></P><P>Overcoming this error can be a little frustrating, as the same request from Postman went through just fine. The thing is, that as we used the SOAP adapter, this adapter treats the message in its own way, so we have to:</P><UL><LI>Remove envelope lines from the message</LI><LI>Add namespace. Click anywhere in the iflow canvas, go to Runtime Configuration tab and see the Namespace Mapping</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jirifridrich_5-1714852007259.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105845i7709B12292628A7D/image-size/medium?v=v2&amp;px=400" role="button" title="jirifridrich_5-1714852007259.png" alt="jirifridrich_5-1714852007259.png" /></span></P><P>We just modify the namespace mapping a bit and the final result of our request body is this:</P><PRE><I>&lt;tns:GetInvoiceRequest xmlns:tns="http://example.com/invoiceservice"&gt;</I><BR /><I>&nbsp;&nbsp; &lt;tns:orderId&gt;123456&lt;/tns:orderId&gt;</I><BR /><I>&lt;/tns:GetInvoiceRequest&gt;</I></PRE><P>Now save and deploy the iflow again. The request should go through and return the same result as did in Postman. You can see the payload in Trace mode or have it logged by a Groovy script component.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jirifridrich_6-1714852007260.png" style="width: 444px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/105847i696C0BAB6E27A286/image-dimensions/444x108?v=v2" width="444" height="108" role="button" title="jirifridrich_6-1714852007260.png" alt="jirifridrich_6-1714852007260.png" /></span></P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P> 2024-05-08T17:44:34.750000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/sap-integration-suite-design-guidelines-in-the-integration-flow-editor-of/ba-p/13696362 SAP Integration Suite - Design Guidelines in the integration flow editor of SAP Cloud Integration 2024-05-09T14:14:31.763000+02:00 kamlesh_zanje https://community.sap.com/t5/user/viewprofilepage/user-id/320175 <H1 id="toc-hId-865408159"><STRONG>Introduction</STRONG></H1><P>Design guidelines feature is available in the integration flow editor of SAP Cloud Integration with the 5.59.x/6.51.x to help integration developers to design and develop enterprise-grade integration flows. To know, you can refer the help documentation <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/design-guidelines" target="_blank" rel="noopener noreferrer">Design Guidelines | SAP Help Portal</A> and <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/design-guidelines-view" target="_blank" rel="noopener noreferrer">Design Guidelines View | SAP Help Portal</A>.</P><P>In this community blog, I will give a short overview on the design guidelines. Let us understand the fundamentals of the design guidelines prior having a deep dive.</P><H2 id="toc-hId-797977373"><STRONG>What are Design Guidelines?</STRONG></H2><P>Integration flow design guidelines enable integration developers to design and develop integration flows, interfaces in a robust fashion to safeguard the company's mission critical business processes.</P><P>In the past, these design guidelines were recommendations that were published as product help and prepackaged content on&nbsp;<SPAN>SAP Business Accelerator Hub</SPAN>. You can find the guidelines in the&nbsp;<A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/integration-flow-design-guidelines" target="_blank" rel="noopener noreferrer">Integration Flow Design Guidelines</A>&nbsp;section. Now, the same guidelines are incorporated within the software as rules that help integration developers for easy consumption.</P><H2 id="toc-hId-601463868"><STRONG>Why Design Guidelines?</STRONG></H2><P>Integration flow design guidelines help to improve the quality of the integration flows, interfaces by keeping them readable, easy to understand, avoid memory leaks, avoid performance overhead and helps handling error in a good way.</P><H2 id="toc-hId-404950363"><STRONG>Motivation</STRONG></H2><UL><LI>Design guidelines helps understand the basic capabilities for modeling integration flows.</LI><LI>Provides guidelines to implement the basic enterprise integration patterns.</LI><LI>It helps to improve the performance of integration flows and reduce the possibility of the outages related to OOM, memory consumption etc.</LI><LI>It applies highest security standards.</LI><LI>It enables the integration flows ready for the productive usage.</LI></UL><H2 id="toc-hId-208436858"><STRONG>Availability</STRONG></H2><P>Design guidelines are available in the SAP Cloud Integration across Standalone NEO, Cloud Foundry, and Integration suite.</P><H2 id="toc-hId-11923353"><STRONG>Personas</STRONG></H2><P>Broadly there are two personas involved in the design guidelines configuration and execution process. Please check their roles and responsibility.</P><TABLE width="1156"><TBODY><TR><TD width="377"><P><STRONG>Persona</STRONG></P></TD><TD width="779"><P><STRONG>Responsibility </STRONG></P></TD></TR><TR><TD width="377"><P><STRONG>Tenant administrator/Integration Lead/Solution Architect</STRONG></P></TD><TD width="779"><UL><LI>Configure the design guideline at the tenant level to make it available for all integration flows.</LI><LI>Review the design guidelines compliance report and take a decision for the Go-Live in the production environment.</LI></UL></TD></TR><TR><TD width="377"><P><STRONG>Integration Developer</STRONG></P></TD><TD width="779"><UL><LI>Execute the design guideline on the integration flow. Download the compliance report and share with tenant administrator/integration lead for the review.</LI></UL></TD></TR></TBODY></TABLE><H2 id="toc-hId--184590152"><STRONG>Workflow</STRONG></H2><P>Below diagram depicts the workflow that will benefit you in the usage of the design guidelines. Broadly there are two personas who will be involved in leveraging the benefit of design guidelines.</P><P>Tenant administrator, who will enable the design guidelines at the tenant level and integration developer who shall execute the guidelines on the integration flow to improve the quality.</P><P>Our recommendation is to impose the below process which will help to improve the quality of the integration flow and ensure the smooth transition for the go live in the production environment.</P><P>Let me try to explain the process by taking a following scenario into consideration.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kamlesh_zanje_3-1715255870456.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/108016iCA98D17D5784694A/image-size/large?v=v2&amp;px=999" role="button" title="kamlesh_zanje_3-1715255870456.png" alt="kamlesh_zanje_3-1715255870456.png" /></span></P><P>&nbsp;</P><H3 id="toc-hId--252020938"><STRONG>Configure Design Guidelines</STRONG></H3><P>Configuring and enabling design guidelines is the responsibility of the Tenant Administrator/Integration Lead/Solution Architect.</P><P>We have a dedicated application role for the tenant administrator in NEO and Cloud Foundry. Please refer this documentation <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/persona-2937e5ca6ef448cfb21451a2461cc2a6" target="_blank" rel="noopener noreferrer">Persona | SAP Help Portal</A></P><P>However, tenant administrator can create a custom persona such as solution architect or Integration lead to manage and configure the design guidelines at the tenant level by using the role “WorkspaceDesignGuidelinesConfigure”.</P><P>User having a proper authorization will be able to see Design Guidelines tab in the integration settings page of the Integration Suite tenant. &nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kamlesh_zanje_2-1715255842601.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/108015iF8043F538EC40B6A/image-size/large?v=v2&amp;px=999" role="button" title="kamlesh_zanje_2-1715255842601.png" alt="kamlesh_zanje_2-1715255842601.png" /></span></P><P>Before you enable/disable design guidelines, understand every design guideline and its implications. Consume the in-app help available for each design guideline to learn more.</P><P>You can enable the design guidelines that you think are appropriate for your organization's requirements. Similarly, disable the ones that you think aren't appropriate anymore.</P><P>The design guidelines are logically grouped. For example, all transaction handling related guidelines are grouped under a single category. Some of the logical groupings are&nbsp;<SPAN><STRONG>Handle errors gracefully</STRONG></SPAN>&nbsp;and&nbsp;<SPAN><STRONG>run an integration flow under well-defined boundary conditions</STRONG></SPAN>.</P><P>Severity decides the criticality and importance of the design guidelines. &nbsp;&nbsp;Severity of the design guidelines is categorized as High, Medium, and Low.</P><P>Design guidelines which are switched-on&nbsp;<span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="switched on.png" style="width: 31px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/108294i36EBE0E5C934A828/image-size/large?v=v2&amp;px=999" role="button" title="switched on.png" alt="switched on.png" /></span>will be applicable to the integration flows for the execution.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kamlesh_zanje_6-1715255978232.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/108021i615A3DBDA1589B7F/image-size/large?v=v2&amp;px=999" role="button" title="kamlesh_zanje_6-1715255978232.png" alt="kamlesh_zanje_6-1715255978232.png" /></span></P><P>It is desirable that you like to follow the same design guidelines in your other development tenants, hence, to ease the work, we have offered export/import feature to export the design guidelines with the enabled/disabled status from one tenant and import the same in another tenant This way, you don't have to manually enable the same design guidelines in multiple tenants.</P><H3 id="toc-hId--448534443"><STRONG>Execute Design Guidelines<BR /></STRONG></H3><P>As we discussed, design guidelines are rules that help you design robust integration flows. Your tenant administrators or integration leads would have enabled all or a subset of available design guidelines that they think are appropriate for your organization's business needs.</P><P>Integration developer responsibility would be to execute the design guidelines after they have developed the integration flow.&nbsp;You can also run the guidelines on the already developed integration flows as well.</P><P>Guidelines which are mandated by the tenant administrator or Integration lead will participate in the execution of the design guidelines on the selected integration flow.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kamlesh_zanje_7-1715256024186.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/108022i2745D5AC3D65508F/image-size/large?v=v2&amp;px=999" role="button" title="kamlesh_zanje_7-1715256024186.png" alt="kamlesh_zanje_7-1715256024186.png" /></span></P><P>Remember that not all enabled design guidelines are applicable for every integration flow that you create. The integration flow editor intelligently identifies the design guidelines that are applicable and validates the integration flow only against the applicable ones. Applicability – “Not Applicable” means the corresponding guidelines is not applicable to your integration flow.</P><P>Compliance status can be either “Compliant” or “Non-Compliant”. If the integration flow is not compliant to the guidelines, then analysis&nbsp;<span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="analysis.png" style="width: 32px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/108293i16C7319E0B352AFA/image-size/large?v=v2&amp;px=999" role="button" title="analysis.png" alt="analysis.png" /></span>report will be provided which will educate integration developer how to fix the failed guidelines and ensure the quality of your interface. Analysis will also cover the model step where the fix must be applied. Easy navigation to the problematic step of the integration flow is offered to ease the job of the integration developer.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kamlesh_zanje_8-1715256055922.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/108024iC2AB2FC57C416B36/image-size/large?v=v2&amp;px=999" role="button" title="kamlesh_zanje_8-1715256055922.png" alt="kamlesh_zanje_8-1715256055922.png" /></span></P><P>Once the design guidelines are made compliant, our recommendation is to download the report and share with the integration lead/Tenant administrator/Solution Architect so they can review the guidelines report and take a decision for transport of the integration content to the production environment for the Go-Live.</P><H2 id="toc-hId--774130667"><STRONG>FAQs</STRONG></H2><UL><LI>In which product of SAP Cloud Integration, design guidelines feature is available?</LI></UL><P style=" padding-left : 30px; ">Design guidelines is available in Cloud Integration NEO, Cloud Foundry, and Integration Suite all editions.</P><UL><LI>Who can configure, enable/disable design guidelines at the tenant level in the integration settings page?</LI></UL><P style=" padding-left : 30px; ">Tenant administrator or the user having the application role – “WorkspaceDesignGuidelinesConfigure”.</P><UL><LI>Do the non-compliant design guidelines lead to integration flow deployment failure?</LI></UL><P style=" padding-left : 30px; ">No.</P><UL><LI>Do the non-compliant design guidelines lead to content transport failure?</LI></UL><P style=" padding-left : 30px; ">No.</P><UL><LI>Can I execute design guidelines on the standard pre-packaged integration content?</LI></UL><P style=" padding-left : 30px; ">Yes, you can execute design guidelines on standard and custom integration content.</P><UL><LI>Can I execute design guidelines on the read-only Integration flow?</LI></UL><P style=" padding-left : 30px; ">Yes.</P><UL><LI>Who can execute design guidelines on the integration flow?</LI></UL><P style=" padding-left : 30px; ">Integration developer can execute the guidelines on the integration flow.</P><UL><LI>Do the support users are allowed to download design guidelines compliance report?</LI></UL><P style=" padding-left : 30px; ">No, they cannot download the report. However, they can visualize the guidelines compliance result in the integration flow editor.</P><UL><LI>Can I know when the last time the design guidelines was executed on the integration flow?</LI></UL><P style=" padding-left : 30px; ">Yes, we show the datetime information in the design guidelines tab of the integration flow after the guidelines are executed.</P><UL><LI>Can I know on which version of integration flow the design guidelines was executed?</LI></UL><P style=" padding-left : 30px; ">Yes, we show the integration flow version in the design guidelines tab of the integration flow.</P><UL><LI>Can integration developer remove the design guidelines which are mandated by the tenant administrator?</LI></UL><P style=" padding-left : 30px; ">No, guidelines which are mandated cannot be removed by the integration developer from the execution.</P><UL><LI>In which format I can download the design guidelines compliance report</LI></UL><P style=" padding-left : 30px; ">Report is available in the xls format.</P><H2 id="toc-hId--623389815"><STRONG>What’s coming next?</STRONG></H2><P>We have the following increments planned in the succession.</P><OL><LI>Increase the coverage by adding more design guidelines for the integration flow.</LI><LI>Skip design guidelines – If the design guidelines fail (i.e., non-compliant), we want to offer a feature for the integration developer to skip the failed design guidelines with his/her consent mainly to block the false positive guidelines failure.</LI><LI>Public Remote APIs for enabling CI/CD requirements.</LI><LI>Restrict deployment and transport of the integration flow but via a proper governance and transparency.</LI><LI>Enable design guidelines in the Script Collection, Message Mapping, and other applicable artifacts.</LI><LI>Custom design guidelines for the customers to write their own custom rules.</LI></OL><P>I am also planning to write a developer tutorial with an example. Stay tuned !</P><P>Hope you will get benefited with this feature. Please experience the feature and provide your valuable feedback.</P> 2024-05-09T14:14:31.763000+02:00