GitHub user Lau08 added a comment to the discussion: What am I missing while 
trying to embed a dashboard?

This config worked for me:

```
FEATURE_FLAGS = { "ALERT_REPORTS": True, "EMBEDDED_SUPERSET": True }
 
GUEST_ROLE_NAME = "Gamma"
GUEST_TOKEN_JWT_SECRET = "your-secret-here"
GUEST_TOKEN_JWT_AUDIENCE = "audi"
 
TALISMAN_ENABLED = False
 
OVERRIDE_HTTP_HEADERS = {
    "X-Frame-Options": "ALLOWALL",
    "Content-Security-Policy": "frame-ancestors 'self' http://localhost:5173";
}
ENABLE_CORS = True
```

And in the dashboard to embed in superset, copy the URL like this: 
http://localhost:5173 with the http://

<img width="601" height="351" alt="image" 
src="https://github.com/user-attachments/assets/e0532394-8ae7-4475-8ef5-023755d718e3";
 />

This worked using a guest token, payload to get it from the Svelte application 
in my case, and using the SDK:
```
const payload = {
                user: {
                        first_name: 'Embedded first_name',
                        last_name: 'Embedded last_name',
                        username: 'Embedded_user'
                },
                resources: [
                        {
                                id: SUPERSET_DASHBOARD_ID, //your dashboard id
                                type: 'dashboard'
                        }
                ],
                rls_rules: [],
                aud: "audi", // same as GUEST_TOKEN_JWT_AUDIENCE in superset
                type: 'guest'
        };

const token = encodeJwt(payload, SUPERSET_GUEST_SECRET);
```


GitHub link: 
https://github.com/apache/superset/discussions/18814#discussioncomment-14035684

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: 
notifications-unsubscr...@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to