Hi,
I’m currently upgrading our Rails app to the latest Shopify App Bridge (via the CDN script) and have run into a roadblock regarding the OAuth installation flow.
Context & Setup:
-
Tech Stack: Ruby on Rails.
-
App Environment: Functions both as an embedded Shopify app and as a standalone app outside of Shopify.
-
Config: We have
use_legacy_install_flow = trueset in ourshopify.app.toml.
Because we rely on the legacy OAuth flow to request access scopes, we need to “escape the iframe” used to embed the app, as stated in the Manage access scopes documentation.
The Problem: In the past, we successfully used the Redirect action from previous versions of App Bridge to handle this. We were closely following the implementation from the shopify_app gem (v21.10.0)—specifically app_bridge_redirect.js—and it worked flawlessly.
However, after updating to the latest CDN-based App Bridge, window['app-bridge'] no longer exists, which completely breaks our existing redirect script.
What we’ve tried: We looked at the App Bridge migration guide, which suggests replacing the old Redirect actions with standard browser routing, specifically window.open(redirectUrl, '_top').
However, replacing our App Bridge redirect script with window.open(..., '_top') isn’t working for us. It fails to actually escape the iframe to hit the OAuth grant URL, and stuck at the page as shown in the following screenshot.
Question: What is the recommended way to escape the iframe for the OAuth flow using the latest App Bridge when use_legacy_install_flow = true?
Thanks in advance.
