Development discussions around Shopify APIs
I’ve recently made an unlisted Shopify app using the ruby on rails gem.
When I had initially set up, I was able to successfully install/uninstall the app.
Now, however, I am unable to load the app to a different development store or live store.
When I attempted to install the app to a client’s live store, I visited the url: https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={redirect_uri}
I am directed to the appropriate installation prompt. After clicking “Install unlisted app”, I’m directed to https://myapp.heroku.com/login? where I am asked to “Enter shop domain to install”.
After doing so, all that happens is that I’m directed to https://myapp.heroku.com/login?top_level=true and the input field is reset.
My app dashboard does say that the app was installed, but when I go to the store and click on the app I am sent to httsp://myapp.heroku.com/login? and the process repeats. I can not actually access the app.
Incidentally, the same thing happens when I enter https://myapp.heroku.com/?auth/shop={mystore}
During the development of the app, I didn’t touch any of the files provided by the gem for authentication so I’m very confused while all of a sudden I’m having these issues.
Nothing in the server logs gives me any insight into why this is happening and I've gone over the oauth documentation several times to try and understand what I'm missing. I am a bit stuck and not sure how to proceed.
Thanks in advance for any help!
Solved! Go to the solution
This is an accepted solution.
Thanks for the code @mthdvd.
It appears to be a config issue - setting `config.embedded_app` to false seems to resolve the issue. Let me know how it goes.
Scott | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hey @mthdvd,
Check the URLs you have the in Partner Dashboard > Your App > App Setup. There's also a breakdown of the OAuth flow here.
If you're still stuck, please let me know the App ID or URL.
Scott | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
@SBD_ , thank you for your reply!
I believe the whitelisted URLs are correct. They have worked before when I installed previously. They have never been changed and throw a recognizable error when they do not work.
URLs
https://{appurl}/auth/shopify/callback
http://{appurl}/auth/shopify/callback
App ID: 3243723
Thanks again!
Thanks @mthdvd. I'm able to replicate.
The urls look good. Is it still working for you locally?
Scott | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Thanks for the code @mthdvd.
It appears to be a config issue - setting `config.embedded_app` to false seems to resolve the issue. Let me know how it goes.
Scott | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thank you! That took care of the issue.
I guess this was happening since I installed the app from the direct url I mentioned above? Not quite sure I fully understand, but I'll do some more investigating if it starts to bug me too much.
Thanks again, @SBD_!
Hi Scotty,
I'm in the same boat, setting `config.embedded_app` to false does work for me. However, my app is an embedded app, so your fix gives me new problems.
Do any other potential fixes come to mind?
Thanks,
Oli
Hi Oli,
Was having the same issues. Mine too is an embedded app (Rails 6 on heroku). This is what worked for me:
set `config.embedded_app` to false just to get the app installed. check that the Shop was correctly registered in the DB.
once installed set the `config.embedded_app` back to true and push to heroku
Thanks Seannik. I bumped into a couple of problems like this along the way. A really handy strategy I found was to double-check my code with the current Shopify Rails app Git repo. Even in the 5 months since I started my development there were meaningful changes with the webhooks and callbacks controller.
User | RANK |
---|---|
46 | |
16 | |
9 | |
9 | |
7 |
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023