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:
To verify that the problem wasn’t specific to our app code, I used the demo React app included in a tutorial: https://github.com/Shopify/shopify-demo-app-node-react
I set this up as is defined in the documentation, and the behaviour is as follows:
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.
Solved! Go to the solution
This is an accepted solution.
We released v3.1.61 of koa-shopify-auth this afternoon that should fix issues with Safari 13.1: https://www.npmjs.com/package/@shopify/koa-shopify-auth/v/3.1.61
Please give it a try and let us know if it works for you!
This is an accepted solution.
Just a note for anyone who finds this topic and is still having this problem:
We recently switched to using cookieless authentication, which has resolved the problem permanently for us. Check out the pinned article Introducing cookieless authentication beta with App Bridge for discussion, and there is more information in Shopify's Authenticate your app using session tokens tutorial.
I hope this helps.
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.
similar behavior in Firefox. Really annoying. Hope there will be a solution in @shopify/koa-shopify-auth soon
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 am having a similar problem in both Safari and Chrome. I'm new to developing apps with shopify and have been using the tutorial here:
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/pag... ) 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?
Any news? This starts to impact more and more clients every day, and I cannot manage to find any workaround.
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?
For Safari, I'm unable to get the redirect loop at all. When I use this URL format (https://9f508623.ngrok.io/auth?shop=lee-stageten-store.myshopify.com) but replaced with my own app and shop, I actually receive an error message saying that the shop url is invalid. What do you see when installing with this url instead? https://9f508623.ngrok.io/auth/inline?shop=lee-stageten-store.myshopify.com
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.
Everything works fine for about month ago. Now i'm stuck with redirect loop
Okay, i've update all libs with npm update, then clean cache and install again. Now, seems like redirect issue is gone
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."
I hope this additional information helps.
This seems to be Safari Version 13.1 specific issue to me. Consistently able to reproduce on this version of Safari and looks fine.
@AvocadosLab I have Safari Version 13.0.5 (15608.5.11) and have the same issue.
is there meanwhile a solution for this bug?
I am getting this error message each time when I access my Insta and FB app in Shopify. My product catalogue doesn't get synchronised anymore neither.
Have you created a collection on your online store and experienced an issue with adding yo...By Ollie Aug 24, 2022
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...By Ollie Jul 28, 2022