We return the values https://.myshopify.com and admin.myshopify.com to ensure that only shopify shops and admin works. But it got reject, do someone knows why? Does shopify requires to return only the requested shop domain? Does the wildcard domain https://.myshopify.com is not valid for shopify?
There’s no information in the documentation, and returning a wildcard domain is a valid response. So we don’t know what happened. Do you have any recommendations?
Personally I added middleware to server, where I am getting shop url from request headers, and add this to response csp. Just resubmitted the app, will see if that works out. Those instructions Shopify included are way too short, not sure if they require this frame-ancestors during installation process as well or what. Would appreciate more info on that from Shopify
We got our application approved, we needed to reply for each request the requested shop’s domain and admin.shopify.com, for example, if example-store.myshopify.com does a request to our app. We reply with:
In which file you have added the code ?
I have tried this syntax
header(“Content-Security-Policy: frame-ancestors https://”.$_SESSION[‘shop’]."myshopify.comhttps://admin.shopify.com;");
Hi, thanks for this very useful answer. Did you have to set this response’s header for ALL the responses sent to shops? Even for assets (css, js, pictures, etc.) or only for html content displayed on the shop’s side via an iframe?