Enable Superset embed Dashboard, but cannot get the embed Dashboard using guest_token #34713
Replies: 1 comment
-
Hi @chaijinglong! I'm Dosu and I’m helping the superset team. The main issue is that the guest_token must be sent in the header specified by your config (default: Try this: curl --location 'http://10.23.22.245/api/v1/dashboard/2fe82db9-48a8-496f-979d-08fc0d0ac5dc/' \
--header 'X-GuestToken: <your-guest-token-here>' Replace Also, double-check that the dashboard UUID is correct and that the dashboard is published. If you still get a 404, the dashboard might not exist or isn't published. Your configuration and permissions look correct for embedding. If you continue to have issues, check the Superset backend logs for more details on the error. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version: 5.0.0
Docker startup
1 Log in using /api/v1/security/login
curl --location 'http://10.23.22.245/api/v1/security/login' \
curl --location 'http://10.23.22.245/api/v1/security/guest_token/' \
3 Use the token from the previous step to get the embed Dashboard information
Both methods failed
The first method
curl --location 'http://10.23.22.245/api/v1/dashboard/' \
4 superset_config.py is configured as follows
import os
MAPBOX_API_KEY = "thisISaSECRET_1234"
CACHE_CONFIG = {
"CACHE_TYPE": "RedisCache",
"CACHE_DEFAULT_TIMEOUT": 300,
"CACHE_KEY_PREFIX": "superset_",
"CACHE_REDIS_HOST": "redis",
"CACHE_REDIS_PORT": 6379,
"CACHE_REDIS_DB": 1,
"CACHE_REDIS_URL": "redis://redis:6379/1",
}
FILTER_STATE_CACHE_CONFIG = {**CACHE_CONFIG, "CACHE_KEY_PREFIX": "superset_filter_"}
EXPLORE_FORM_DATA_CACHE_CONFIG = {**CACHE_CONFIG, "CACHE_KEY_PREFIX": "superset_explore_form_"}
SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://superset:test@db:5432/test"
SQLALCHEMY_TRACK_MODIFICATIONS = True
BABEL_DEFAULT_LOCALE = "zh"
LANGUAGES = {
"en": {"flag": "us", "name": "English"},
"zh": {"flag": "cn", "name": "Chinese"},
}
SECRET_KEY = "CRET_1234"
FEATURE_FLAGS = {
"ENABLE_TEMPLATE_PROCESSING": True,
"EMBEDDED_SUPERSET": True,
"EMBEDDABLE_CHARTS": True,
"DASHBOARD_RBAC": False
}
GUEST_ROLE_NAME = "test_role"
GUEST_TOKEN_JWT_SECRET = "SECRET_2343"
GUEST_TOKEN_JWT_ALGO = "HS256"
GUEST_TOKEN_HEADER_NAME = "X-GuestToken"
GUEST_TOKEN_JWT_EXP_SECONDS = 3600
WTF_CSRF_ENABLED = False
OVERRIDE_HTTP_HEADERS = {'X-Frame-Options': 'ALLOWALL'}
TALISMAN_ENABLED = False
ENABLE_CORS = True
CORS_OPTIONS = {
'supports_credentials': True,
'allow_headers': [''],
'resources': [''],
'origins': ['*']
}
FAB_ADD_SECURITY_API = True
DEBUG = True
5 GUEST_ROLE_NAME = "test_role" is configured as follows
× can read on Chart
× can write on Chart
× can read on Dataset
× can read on Dashboard
× can write on Dashboard
× can read on Database
× can this form get on ResetMyPasswordView
× can this form post on ResetMyPasswordView
× can userinfo on UserDBModelView
× resetmypassword on UserDBModelView
× can get on OpenApi
× can show on SwaggerView
× can get on MenuApi
× can list on AsyncEventsRestApi
× can read on AdvancedDataType
× can read on AvailableDomains
× can invalidate on CacheRestApi
× can export on Chart
× can write on DashboardFilterStateRestApi
× can read on DashboardFilterStateRestApi
× can read on DashboardPermalinkRestApi
× can write on DashboardPermalinkRestApi
× can cache dashboard screenshot on Dashboard
× can get embedded on Dashboard
× can export on Dashboard
× can delete embedded on Dashboard
× can read on EmbeddedDashboard
× can read on Explore
× can write on ExploreFormDataRestApi
× can read on ExploreFormDataRestApi
× can read on ExplorePermalinkRestApi
× can write on ExplorePermalinkRestApi
× can read on Tag
× can write on Tag
× can bulk create on Tag
× can format sql on SQLLab
× can estimate query cost on SQLLab
× can list on DynamicPlugin
× can show on DynamicPlugin
× can query on Api
× can time range on Api
× can query form data on Api
× can get on Datasource
× can external metadata by name on Datasource
× can external metadata on Datasource
× can list on SavedQuery
× can dashboard on Superset
× can log on Superset
× can explore json on Superset
× can explore on Superset
× can slice on Superset
× can fetch datasource metadata on Superset
× can dashboard permalink on Superset
× can list on Tag
× can tags on TagView
× can recent activity on Log
× can read on SecurityRestApi
× can grant guest token on SecurityRestApi
× can read on RowLevelSecurity
× menu access on Home
× menu access on Data
× menu access on Databases
× menu access on Dashboards
× menu access on Charts
× menu access on Datasets
× menu access on Plugins
× menu access on Tags
× can csv on Superset
× can share dashboard on Superset
× can share chart on Superset
× can view query on Dashboard
× can view chart as table on Dashboard
× can drill on Dashboard
× can tag on Chart
× can tag on Dashboard
Help me find out what the problem is
Beta Was this translation helpful? Give feedback.
All reactions