<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to Allow Framing of CyberSource in iframe with CSP frame-ancestors Directive? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-to-Allow-Framing-of-CyberSource-in-iframe-with-CSP-frame/m-p/91091#M57235</link>
    <description>&lt;P&gt;I'm working on embedding a page from &lt;A href="https://apitest.cybersource.com/" target="_blank" rel="noopener"&gt;https://apitest.cybersource.com/&lt;/A&gt; in an iframe, but I'm encountering the following error:&lt;BR /&gt;Refused to frame '&lt;A href="https://apitest.cybersource.com/" target="_blank" rel="noopener"&gt;https://apitest.cybersource.com/&lt;/A&gt;' because an ancestor violates the following Content Security Policy directive: "frame-ancestors &lt;A href="https://example.com&amp;quot;" target="_blank" rel="noopener"&gt;https://example.com".&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It is restricting to show the div&amp;nbsp;&lt;SPAN&gt;components that are replaced with&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Click to Pay Drop-In UI&amp;nbsp;iframes&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;H3&gt;What I’ve Tried:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Adding CSP Headers in Node.js:&lt;/STRONG&gt; I attempted to modify the Content-Security-Policy header in my Express.js server:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;js&lt;/DIV&gt;&lt;DIV class=""&gt;res.&lt;SPAN class=""&gt;setHeader&lt;/SPAN&gt;( &lt;SPAN class=""&gt;'Content-Security-Policy'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"frame-ancestors 'self' &lt;A href="https://example.com" target="_blank" rel="noopener"&gt;https://example.com&lt;/A&gt; &lt;A href="https://apitest.cybersource.com" target="_blank" rel="noopener"&gt;https://apitest.cybersource.com&lt;/A&gt;;"&lt;/SPAN&gt; );&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 10:55:40 GMT</pubDate>
    <dc:creator>shivani_kumbhar</dc:creator>
    <dc:date>2025-01-21T10:55:40Z</dc:date>
    <item>
      <title>How to Allow Framing of CyberSource in iframe with CSP frame-ancestors Directive?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-to-Allow-Framing-of-CyberSource-in-iframe-with-CSP-frame/m-p/91091#M57235</link>
      <description>&lt;P&gt;I'm working on embedding a page from &lt;A href="https://apitest.cybersource.com/" target="_blank" rel="noopener"&gt;https://apitest.cybersource.com/&lt;/A&gt; in an iframe, but I'm encountering the following error:&lt;BR /&gt;Refused to frame '&lt;A href="https://apitest.cybersource.com/" target="_blank" rel="noopener"&gt;https://apitest.cybersource.com/&lt;/A&gt;' because an ancestor violates the following Content Security Policy directive: "frame-ancestors &lt;A href="https://example.com&amp;quot;" target="_blank" rel="noopener"&gt;https://example.com".&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It is restricting to show the div&amp;nbsp;&lt;SPAN&gt;components that are replaced with&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Click to Pay Drop-In UI&amp;nbsp;iframes&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;H3&gt;What I’ve Tried:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Adding CSP Headers in Node.js:&lt;/STRONG&gt; I attempted to modify the Content-Security-Policy header in my Express.js server:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;js&lt;/DIV&gt;&lt;DIV class=""&gt;res.&lt;SPAN class=""&gt;setHeader&lt;/SPAN&gt;( &lt;SPAN class=""&gt;'Content-Security-Policy'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"frame-ancestors 'self' &lt;A href="https://example.com" target="_blank" rel="noopener"&gt;https://example.com&lt;/A&gt; &lt;A href="https://apitest.cybersource.com" target="_blank" rel="noopener"&gt;https://apitest.cybersource.com&lt;/A&gt;;"&lt;/SPAN&gt; );&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 10:55:40 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-to-Allow-Framing-of-CyberSource-in-iframe-with-CSP-frame/m-p/91091#M57235</guid>
      <dc:creator>shivani_kumbhar</dc:creator>
      <dc:date>2025-01-21T10:55:40Z</dc:date>
    </item>
  </channel>
</rss>

