Developers are encountering an endless OAuth redirect loop when implementing Shopifyâs recommended App Bridge redirect script for embedded apps. The loop typically cycles 3-4 times before displaying an error: âThe app couldnât be loadedâ with a same_site_cookies OAuth error parameter.
Common symptoms:
Error appears inconsistently across browsers (Chrome, Firefox, Chromium)
Occurs even when apps donât use cookies
Happens particularly after multiple page refreshes within a short timeframe
X-Frame-Options âdenyâ errors appear in console
We have a working embedded app that can successfully go through OAuth flow and present our app embedded in Shopify Admin.
So far our app link has been pointing to our server OAuth EP to start and complete the flow. The one thing we never did is implement the recommended OAuth redirect script as explain here: App Bridge - Authenticate with OAuth . Meaning that our current OAuth process is not escaped from the iFrame and the OAuth scopes accept screen cannot be shown if required to.
We implemented the script as shown in the example using App Bridge Redirect. Now the OAuth process starts with the script.
The problem is: when trying to access our app on Shopify Admin, this results in an endless loop between Shopfiy and our App that ends with this error:
The app couldnât be loaded
This app canât load due to an issue with browser cookies. Try enabling cookies in your browser, switching to another browser , or contacting the developer to get support.
Instead of landing in the embedded appâs landing page as expected the whole process is started again in a loop for 3-4 times until we receive the error above.
The thing is - our app doesnât use cookies at all so I donât understand the same_site_cookie error. Also, Chrome debug tools doesnât indicate any Samesite cookie issues either.
did you ever get a solution to this? I have a similar issue, my app installs and authenticates fine, but if you refresh the browser 3-4 times in a row in a 1 minute window, on the last time I get this error
Never was able to work out why this isnât working as expected.
As interim solution we took our admin app outside of the embedded Shopify admin pages - at least until they find a more robust method to integrate into admin and work around all the 3rd party cookie issues (again, our app doesnât even use cookies).
Facing this issue as well. Does anyone have a solution or documentation to point to? Simply switching to Firefox or another browser isnât fixing this for us.
Iâm having this issue in a very random way and only in a really few cases. But the same computer and the same Chrome browser sometimes work and sometimes donât. So itâs quite difficult to find a specific cause. Suggestions appreciated.
The âoauth_error=same_site_cookiesâ error can occur if the access scopes configured on the deployed server do not match the scopes defined for the app in in Shopify.
In my case, the problem of infinite OAuth redirects was caused by inconsistent access scopes.
Run the command pnpm run shopify app info and check the access scopes. It must be the same as access scopes defined on the production server in the .env file. If it is different you have to change the config locally and push it with pnpm run shopify app config push command.