- Newest
- Most votes
- Most comments
Based on the error you're encountering, this appears to be a domain allowlist issue. The error "DomainNotWhiteListedException" indicates that the domain where you're trying to embed the QuickSight dashboard has not been added to the approved list.
To resolve this issue, you need to ensure that:
-
Add the domain to the allowlist in QuickSight console: In Amazon QuickSight Enterprise edition, navigate to the QuickSight console and add your hosting domain to the approved domains list. You can add up to 100 static domains through the console. All domains must use HTTPS protocol.
-
Verify the AllowedDomains parameter: In your code, the
AllowedDomainsparameter in thegenerate_embed_url_for_registered_userAPI call should match exactly with the domain where you're hosting the embedded dashboard. This parameter allows you to specify up to three domains or subdomains at runtime. -
Check domain format: Ensure your domain follows the correct format. Valid domains should look like:
Invalid formats include wildcards, domains without protocols, or IP addresses with ports.
- IAM Policy permissions: Verify that your IAM policy includes the appropriate permissions and uses condition operators to limit which domains can be specified in the
AllowedDomainsparameter. This prevents unauthorized domains from accessing your embedded content.
The domain hosting your embedded dashboard must be explicitly approved before the embedded URL will work. Once you've added your domain to the allowlist in the QuickSight console and ensured it matches what's specified in your AllowedDomains parameter, the error should be resolved.
Sources
Managing domains - Amazon Quick Suite
Embedding Amazon Quick Sight dashboards for registered users - Amazon Quick Suite
Amazon Quick Sight API Errors - Amazon Quick Sight
Most embed URL failures come down to (1) domain allowlist, (2) user/dashboard permissions, or (3) region/account mismatch.
Quick checks: • AllowedDomains must match the exact scheme + host you open from (e.g., https://app.example.com), no paths, no wildcards. • The UserArn must be a valid QuickSight user in the same account/region/namespace, and the dashboard must be shared to that user.
CLI to validate:
aws quicksight describe-user --aws-account-id <acct> --namespace default --user-name <name>
aws quicksight describe-dashboard-permissions --aws-account-id <acct> --dashboard-id <dashId>
Code fix
resp = self.client.generate_embed_url_for_registered_user( AwsAccountId=self.config.account_id, UserArn=self.user_arn, SessionLifetimeInMinutes=60, ExperienceConfiguration={'Dashboard': {'InitialDashboardId': dashboard_id}}, AllowedDomains=['https://app.example.com'] ) return resp['EmbedUrl']
Also ensure your boto3 client uses the same region as QuickSight.
answered 9 months ago
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated 4 months ago
