(1) I have C# code to get embedded dashboard url
var ret = await client.GetDashboardEmbedUrlAsync(new GetDashboardEmbedUrlRequest { AwsAccountId = _awsAccountID, DashboardId = _dashboardId, Namespace = default, IdentityType = EmbeddingIdentityType.QUICKSIGHT, SessionLifetimeInMinutes = 600, UndoRedoDisabled = true, ResetDisabled = true, UserArn = _userArn }).ConfigureAwait(false); return ret.EmbedUrl;
(2) After I get the embedded url, I uses
to embed the dashboard in html div
this.embeddedDashboard = await embeddingContext.embedDashboard(
frameOptions,
contentOptions
);
(3) I used the embedded url several times with different data to display same quicksight dashboard to generate different reports.
(a) First call is successful
(b) Second call results in following error
Embedding failed because of invalid URL or authorization code. Both of these must be valid and the authorization code must not be expired for embedding to work.
How do I need to do resolve the issue?
duncan
April 4, 2025, 2:33pm
2
Hello @hubaozhang , welcome to the QuickSight community!
I would check out these two topics where users ran into similar issues:
I am generating an embed url for QuickSight for Anonymous user. I am not consuming that url on my side. I gave the url to my friend immediately and he paste’s it in his browser. He is not able to view the Dashboard and the following message is shown Embedding failed because of invalid URL or authorization code. Both of these must be valid and the authorization code must not be expired for embedding to work. Now if I paste that URL in my browser I am able to see it. How is it happening that my fr…
Hi,
I’m using generate_embed_url_for_anonymous_user(SessionTags is being used and SessionLifetimeInMinutes is set to 600) to render url for frontend to embed. This is all working fine until I navigated away from the page embedding the dashboard and back where I got error “Embedding failed because of invalid URL or authorization code. Both of these must be valid and the authorization code must not be expired for embedding to work”.
So internally, I’m using GraphQL endpoint to generate the embed…
Thanks for the link. The link has answers why it is not working, but there is no answer how to solve the problem.
Brett
April 21, 2025, 6:21pm
4
Hi @hubaozhang ,
I would suggest exploring the QuickSight Developer Portal . It focuses on various embedding options and helps guide you through step by step processes. Please review and let us know if this helps with your case.