Hi, I’ve been developing my app locally using ngrok without errors but when trying to run it on my linux server this issue occurs.
Refused to display '{URL}' in a frame because it set 'X-Frame-Options' to 'deny'.
I am assuming it has something with the redirect with during OAuth but I followed the React tutorials and assumed that is how it should be setup. Do I need to add in the redirect functionality described here https://help.shopify.com/en/api/embedded-apps/app-bridge/oauth or should the react tutorial with koa be correct for this?
Haven’t been able to find a solution anywhere for this currently. Any help is appreciated.
If you are following the tutorial of “Build a Shopify app with Node and React”, then through the tutorial you will be asked to utilize the ‘koa-shopify-auth’ package which will handle all of the authentication and OAuth process for you. So you would not need to worry about adding in functionality yourself for handling the authentication + redirection yourself if you are using this package.
For the error you are experiencing, web servers have the option of setting a response header of X-Frame-Options: DENY, which causes the web browser to refuse to render that page if the content window is inside some kind of frame. Since all embedded applications are rendered inside an iframe, this option must be turned off on your web server. Could you verify that this option is turned off on the Linux Web Server you are using to host your application? Get more information about the X-Frame-Option headers here:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options.
@elishakay@linq-dev i AM USING EXPRESS JS WITH NGINX IT WAS WORKING FINE AFTER RESTART SERVICE IT WAS NOT WORKING. CAN YOU PLEAS HELP WHAT WAS ROOT CAUSE ?
server.route({
path: ‘/’,
method: ‘GET’,
handler: function (request, reply) {
reply.redirect(‘https://apps.shopify.com/partners/widgetic’)
.header(‘Content-Security-Policy’, frame-ancestors https://${request.query.shop} [https://admin.shopify.com](https://admin.shopify.com))
.header(‘X-Frame-Options’, ‘ALLOW-FROM *’);
},
And even if we add the header, the "