backstage icon indicating copy to clipboard operation
backstage copied to clipboard

Referrer is not set when attempting to embed a 3rd party page

Open vandr0iy opened this issue 2 months ago • 4 comments

📜 Issue Labels

  • [x] Please familiarize yourself with the issue labels used in this project: LABELS.md

🔎 Search Terms

datadog referrer iframe origin

🗃️ Project Area

Catalog

🔗 External Integration

Other

📝 Description & Context

When attempting to embed a datadog graph as mentioned in this document it appears impossible to fetch the said graph if it's restricted by the Referrer, because the catalog page appears not to be sending one in the headers:

Image

Specifically - it appears that backstage by default sets its Referrer Policy to 'no-referrer', and there seems not to be any setting in app-config.yaml that allows to change this. Would it be possible to have one?

👍 Expected Behavior

Having a setting that looks something like

app:
  referrerPolicy: strict-origin-when-cross-origin

In order to be able to pass the referrer to the embedded webpages so that they may validate it and return 200

📦 Reproduction Repo

No response

🥾 Reproduction steps

  1. Follow the Official guide to embed a datadog dashboard
  2. restrict the said dashboard to the value of your backstages' window.location.origin
  3. load the catalog page of the entity that's got the dashboard embedded

Have you read the Code of Conduct?

Are you willing to submit PR?

No, but I'm happy to collaborate on a PR with someone else

vandr0iy avatar Oct 30 '25 14:10 vandr0iy

it appears that backstage by default sets its Referrer Policy to 'no-referrer'

This is the default policy of the helmet middleware that's being added by default to all routes. It does have some configurability, which is fetched here. Indeed, it does not set the referrerPolicy at this time but it could be added. Opening up for contributions!

freben avatar Nov 03 '25 19:11 freben

@freben would something like this work?

vandr0iy avatar Nov 07 '25 13:11 vandr0iy

@freben would something like this work?

Hi @vandr0iy, Freben left comments on the PR you linked. Please take a look when you have some time 🙂 .

camilaibs avatar Nov 12 '25 13:11 camilaibs

comments addressed, please take a second look @camilaibs / @freben

vandr0iy avatar Dec 09 '25 10:12 vandr0iy