Skip to content

Issues with QuickSight Dashboard Embedded URLs

0

I am attempting to generate embedded URLs to view QuickSight dashboards. However, when loading the URL in the browser, I encounter the error shown in the attached image.

I have also included the relevant snippet of the code used to generate these URLs. We have tried several troubleshooting steps but have not yet identified the root cause. I would greatly appreciate your guidance on this matter.

    def get_dashboard_url(self, dashboard_id: str) :
        try:
            return self.client.generate_embed_url_for_registered_user(
                AwsAccountId=self.config.account_id,
                SessionLifetimeInMinutes=self.config.session_lifetime,
                UserArn=self.user_arn,
                ExperienceConfiguration={
                    'Dashboard': {'InitialDashboardId': dashboard_id}
                },
                AllowedDomains=self.config.allowed_domains
            )
        except ClientError as e:
            raise e

Enter image description here

asked 9 months ago258 views

2 Answers
1

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:

  1. 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.

  2. Verify the AllowedDomains parameter: In your code, the AllowedDomains parameter in the generate_embed_url_for_registered_user API 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.

  3. 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.

  1. 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 AllowedDomains parameter. 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

answered 9 months ago

EXPERT

reviewed 9 months ago

0

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

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.