I am trying to integrate superset to my app but I can’t since I face this error, which is related to frame while I don’t use frame in my code, This is the code:
import { useSelector } from "react-redux";
import { authSelector } from "../../../redux/slices/auth";
import { embedDashboard } from "@superset-ui/embedded-sdk";
import { useEffect } from "react";
function SupersetDashboard({ token }) {
const { company } = useSelector(authSelector);
useEffect(() => {
if (!token) return;
embedDashboard({
id: "49271a6d-182b-4761-9e6c-bf2c51bd1be2",
supersetDomain: "https://dashboard.munjz.com/",
mountPoint: document.getElementById("superset-iframe"),
fetchGuestToken: () => token,
dashboardUiConfig: {
hideTitle: true,
hideChartControls: true,
hideTab: true,
},
rls: [{ clause: `company_id = ${company.id}` }],
});
}, []);
return <div id="superset-iframe"></div>;
}
export default SupersetDashboard;
and this is the error:
Refused to display 'https://dashboard.munjz.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
This is for showing data in my webpage
2
Answers
You might find a solution here
You can not access the site because server set to access from only same origin (domain). If you can administrate ‘https://dashboard.munjz.com/’, delete ‘X-Frame-Option’ header or add
ALLOW-FROM
value.