We have been experiencing a problem where users attempting to access our Shopify App from a Safari browser, either on desktop or iPhone, get caught in an infinite ‘Enable cookies’ loop.
Our app is built as an Embedded App, using the current versions of Shopify’s various libraries. We are using:
I am returned to the same 'Enable cookies’ page as above. Continuing produces the same loop infinitely.
Our own application experiences exactly the same problem.
This all looks related to Safari ITP (https://help.shopify.com/en/api/guides/itp-impact), but it appears newer versions of Safari have broken the solution described in that article. Do you have any further advice or ideas we can try? Given our users will want to use our application from a iOS device, this is a critical issue for us.
Thank you for taking the time to reproduce this issue on a test app and writing up such detailed instructions. I was able to reproduce the issue on my end, and I think you might be onto something, it does appear to be related to Safari ITP. We have a possible fix from a while back in anticipation for this Safari update within the @shopify/koa-shopify-auth utils, but we’ll have to do some tests to verify that it does indeed work. For the time being, there’s no workaround I can think of. Please bear with me while I dig into this issue a bit more, and I’ll share the results ASAP.
Hey folks, I’m following up to let you know that this is still being worked on. A lot has changed since the possible solution was proposed, and there’s quite a bit of catching up. s_werk, thank you for the additional info, it sounds like Firefox also have their own ITP and should be throughly tested as well. Much appreciated ?
I’ve built three test apps; one on my MacBook localhost, one on a FreeBSD server, and one on an Ubuntu server.
The one on localhost, as expected, passes all trust checks and loads as expected into the Shopify interface and as seen in the tutorial.
The installs on the remote servers do not. First the warning about enabling cookies is shown, and then the app loads externally as a redirect. I attempted to implement a user-proposed solution ( https://community.shopify.com/c/Shopify-APIs-SDKs/Embedded-App-not-working-in-Safari/td-p/335934/page/2 ) but it did not work. It does not seem possible with updated browsers to embed an app in the Shopify admin interface.
I wonder if this is working for anyone? Or if users are simply assuming it’s their fault and disabling the browser security?
Hello everyone, thanks for your continued patience on this. It appears that there were a few underlying issues around app auth flow, and not all related to the koa-shopify-auth library, making it quite tricky to debug. A few of those issues were addressed last week, and just yesterday we were able to isolate this bug. Unfortunately the proposed solution from last year didn’t seem to solve the problem, so I am looking into other solutions at the moment.
Hi everyone, thanks for chiming in with your issues. I’m still unable to reproduce the bug consistently, but I did find out that there are actuaally two issues that could cause a redirect loop.
For those who are experiencing this bug in Chrome, do you eventually get redirected back to the app listing page with an error message? Described here in point #3:https://shopify.dev/tutorials/migrate-your-app-to-support-samesite-cookies Also, what version of koa-shopify-auth are you using in your app?
Hi - has there been any movement on this? I have received a couple of complaints from users of my app. I’ve updated to koa-shopify-auth 3.1.58 and the issue is still happening.
Thanks for the response – our issue has always only been in Safari. Our developer investigated further using the the new URL format you provided and our original test steps. He responded with:
“If I clear cookies, go back and try exactly the same steps it fails.”
Further, he performed the test in a private browsing windows and reports:
"I was able to get past the Enable cookies screen once, but the problem reappears.
"To clarify, a full cycle with login to the store and installation using the /auth/inline form of the URL works in a Safari private window, but not in a regular one, regardless of whether I clear all my Shopify and STAGE TEN cookies or not. I have no extensions/ad blockers etc running in Safari.
“Having installed the app successfully in the private window, if I then attempt to access it from a regular Safari window I get the same ‘enable cookies’ loop.”