Unable to append iframe with EmbedUrL

I am unable to append iframe in my localhost.
error:-Refused to frame ‘https://us-west-2.quicksight.aws.amazon.com/’ because an ancestor violates the following Content Security Policy directive: “frame-ancestors http://localhost”.

I have added this domain in quicksight also.

index.html file:-

Basic Embed const embedDashboard = async () => { const { createEmbeddingContext, } = QuickSightEmbedding;
        const embeddingContext = await createEmbeddingContext();

        const containerDiv = document.getElementById("embedding-container");

        const frameOptions = {
            // replace the value below with the one generated via embedding API
            url:"",
            container: containerDiv,
            height: "700px",
            width: "1000px",
        };

        const contentOptions = {
            toolbarOptions: {
                export: false,
                undoRedo: false, // use this option to show or hide the undo and redo buttons
                reset: false, // use this option to show or hide the  reset button
            },
            attributionOptions: {
                overlayContent: false,
            },
        };

        const embeddedDashboard = await embeddingContext.embedDashboard(frameOptions, contentOptions);
    };
</script>

Hello,

The error suggests your web application’s Content Security Policy (CSP) is restricting content access. To address this kindly verify if the CSP in your application is set up correctly and not blocking any Content Security Policy

For CSP setup guidance, refer to AWS Community Post [1] and Third-party resources [2][3]

[1] ERROR - Content Security Policy directive - Help! - #2 by EnriqueS
[2] Content-Security-Policy (Third Party Link) : Content-Security-Policy (CSP) - HTTP | MDN
[3] Content Security Policy (CSP Third Party Link) : Content Security Policy (CSP) - HTTP | MDN

1 Like

Hi @nkj32,
It’s been awhile since we last heard from you, did you have any additional questions regarding your initial post or were you able to find a work around from the solution provided above?

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you!