This repository was archived by the owner on Nov 30, 2022. It is now read-only.
AppBridge issue - Message origin does not match app origin #953
sergeyantonuk
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone!
I am developing App with JWT auth where I use osiset "feature/cookieless" branch of package as fork.
Our frontend is built on react + polaris, backend - this is just API which uses the osisset package.
We use SPA on the architecture where the frontend and backend are on different hosts.
I use ngrok for development for my front and back end.
To implement JWT, I need to initiate an AppBridge on the frontend. To do this, I disabled the AppBridge in the osiset package, since here the AppBridge initialization are performed in the templates.
For testing I just copied the AppBridge initialization code from templates(default.blade.php and token_handler.blade.php) to my frontend, which is located on a different host.
Next I set the backend host as App Url in the App setup (partners.shopify.com -> AppSetup)
In other words, first the index page of my backend is loaded, from which there is a redirect to the frontend, with query parameters where I pass api_key and shop_origin.
After this frontend initialize the AppBridge and then, for any requests to my api, the frontend will transfer a fresh token in the header.
But I got an AppBridge Error like on screenshot:

"Message origin https://frontend.host does not match origin https://backend.host app"
I understand that this is done for security purposes, but how can we disable origin checking for AppBridge for the development process?
Also I tried do to do it through a persistent subdomain created on ngrok, something like this:
be.myapp.ngrok.io - backend
myapp.ngrok.io - frontend
but no success as well.
Can someone give me a hand?
thanks in advance!
Context
Package - "feature/cookieless" branch of package as fork.
Laravel Version: v7.19.1
PHP Version: v7.2.24
I use ngrok for my front and back end
Beta Was this translation helpful? Give feedback.
All reactions