pongsathorn-ph commented on issue #25870: URL: https://github.com/apache/superset/issues/25870#issuecomment-1812066934
Maybe you not enable TALISMAN please follow this config. **superset_config.py** ```python ALLOW_ORIGINS = ['YOUR_BACKEND_URL','http://localhost:4200'] # Cross Origin Config ENABLE_CORS = True CORS_OPTIONS = { 'supports_credentials': True, 'allow_headers': ['*'], 'resources':['*'], 'origins': ALLOW_ORIGINS } # CSRF Config WTF_CSRF_ENABLED = True WTF_CSRF_TIME_LIMIT = 300 # A CSRF token that expires in 5 minutes # Talisman Config TALISMAN_ENABLED = True TALISMAN_CONFIG = { "content_security_policy": { "frame-ancestors": ALLOW_ORIGINS }, "force_https": False, "force_https_permanent": False, "frame_options": "ALLOWFROM", "frame_options_allow_from": "*" } # Dashboard embedding GUEST_ROLE_NAME = "YOUR_GUEST_ROLE_NAME" GUEST_TOKEN_JWT_SECRET = "CUSTOM_GUEST_TOKEN_JWT_SECRET" GUEST_TOKEN_JWT_EXP_SECONDS = 300 # 5 minutes ``` **app.component.html** ```typescript <div id="my-superset-container" style="height: 100vh;"></div> ``` **app.component.ts** ```typescript async ngOnInit(): Promise<void> { const myDashboard = embedDashboard({ id: 'YOUR_DASHBOARD_EMBED_ID', supersetDomain: 'YOUR_SUPERSET_DOMAIN', mountPoint: document.getElementById('my-superset-container') as HTMLElement, // any html element that can contain an iframe fetchGuestToken: async () => await this.supersetService.getGuestToken(), dashboardUiConfig: { // dashboard UI config: hideTitle, hideTab, hideChartControls, filters.visible, filters.expanded (optional) hideTitle: false, filters: { expanded: false, }, }, }); myDashboard.then((data) => { const iframe = document.querySelector('iframe') as HTMLIFrameElement; if (iframe !== null) { iframe.style.width = '100%'; iframe.style.height = '100%'; iframe.style.border = 'none'; } }); } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
