-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oauth error failed_grant_with_invalid_scopes #1839
Comments
Hi @ilrein, It's difficult for me to see what is happening without more information - Could you try the following:
# config/initializers/shopify_app.rb
ShopifyAPI::Context.setup(
#.......
log_level: :debug,
) Also, I'm not sure if the generators are that up to date anymore. If you're creating a new app, you could try creating one straight from our template. that should work right out of the box, and using Shopify CLI will make development/deployment of your app much easier. |
We are closing this issue because we did not hear back regarding additional details we needed to resolve this issue. If the issue persists and you are able to provide the missing clarification we need, feel free to respond and reopen this issue. We appreciate your understanding as we try to manage our number of open issues. |
same issue is happening for me. Fresh install and all URLs are configured properly. |
@zzooeeyy I am also encountered with same issue and I triggered 19:37:07 │ web-backend │ Started POST "/login" for 103.197.153.39 at 2024-06-12 19:37:07 +0600
19:37:07 │ web-backend │ Cannot render console from 103.197.153.39! Allowed networks: 127.0.0.0/127.255.255.255, ::1
19:37:07 │ web-backend │ Processing by ShopifyApp::SessionsController#create as HTML
19:37:07 │ web-backend │ Parameters: {"authenticity_token"=>"[FILTERED]", "shop"=>"sofenx-dev.myshopify.com"}
19:37:07 │ web-backend │ [ ShopifyApp | DEBUG | Shop Not Found ] Starting OAuth - Redirecting to Shopify managed install
19:37:07 │ web-backend │ Redirected to https://admin.shopify.com/store/sofenx-dev/oauth/install?client_id=cfb75542ffbcafdac9ac271d68c583c5
19:37:07 │ web-backend │ Completed 302 Found in 2ms (ActiveRecord: 0.0ms | Allocations: 717) any idea? |
+1 same issue today with fresh install and partner store, please reopen |
sorry I've forgot to mention here that I've resolved the issue. I did some debug and found in my
I have found if we are using After removing this line from |
how did you initialize your app, on partner site maunally, through command line, or through shopify plus? I followed the README's instruction and it seems to suggest to initialize an app manually on partner site first. |
I am having the same issue
@zzooeeyy could this be reopened? |
@andrewchen5678 were you able to fix your issue. I can see a .toml file when starting the rails app from scratch |
I suspect it has to do with the approach to initialize the app manually on partner portal instead of through cli, but I can't confirm further because I changed strategy. I tried many different approaches for getting access token for a private app and ended up initializing an app through cli with a .toml file, installed the app on my shop manually through the partner portal, and created custom oauth endpoint to get access token, for my use case I only needed one offline access token for backend API calls for the shop. It is too much much tight coupling on the Shopify::Context on multi-store workflow, coupled with too many ways to create custom apps, which makes it difficult to use the standard oauth flow to work with private apps only meant for one store. |
@andrewchen5678 Yeahhh creating the app from the CLI works for me as well. but there are a lot of things there I don't need or don't want to use. so wanted to go with a rails app from scratch. |
I followed the steps in the gem's README and got this error as well. I used the manual option on partners site. No shopify.app.toml file was created after I ran the generator. If this file is required, I hope the README gets a section explaining this. |
@mzrns I am using two separate repos. One for app block (front-end for online store) and other for rails app (back end). And in app block part there is the |
Facing the same problem with the shopify app gem. |
Hey all! The reason why the CLI works and the generator doesn't work is because the Previously, your app (behind the scenes and handled in the gem) would need to redirect the user to shopify With the new Shopify managed installation and token exchange authorization flow, you declare the access scopes that your app requires in the Long story short,The generator doesn't configure shopify managed install for your app, but creating the app through the CLI does, that's why it has different behaviours. There are a few options:
OR
|
Hey @zzooeeyy, thank you for looking into this for us 🙏 I, and I believe I speak for everyone here, have no doubts about this new method being more efficient. We don't need to be convinced in that 🙃 The problem worth tackling however, is that with the And once a typical Rails developer like myself decides to embark on that quest, they suddenly have to deal with things like not having a And okay, it's an easy problem to solve, but here comes the next one: I don't know what comes next as I haven't yet found a way around the last one. But does feel like this all should be a little more straightforward, given this is the "official" way to build a Shopify app. |
I have followed all the instructions given in shopify_app gem Readme and facing the similar issue I created the application directly from shopify partner account rather than cli. anyone knows how can I fix it? |
I appreciate the work you are all doing on this but I agree with @mzrnsh. For the Rails community, it seems like a bit of a mess. I'm hitting roadblock after roadblock and it feels way more complicated than it has to be. You should hit the reset button and make a proper and simple solution for vanilla Rails projects. I'm writing this with love. It's simply because I want to develop for Shopify, but it's just not that straightforward. The "new auth strategy" shouldn't even be an option as it's not possible anymore with the 'old'. Also, why the need for a toml file? Seems like I have to repeat myself yet what do I gain? |
@zzooeeyy I see that this is "Closed as not planned". Could you at least update the documentation to reflect the new reality? (again, writing this with nothing but love, but I simply don't understand how to get up and running). |
Issue summary
Before opening this issue, I have:
shopify_app
version:log_level: :debug
in my configuration, if applicableI have created a fresh install. I am able to render the page successfully. When I try to install the shop, I get this:
Expected behavior
I left the defaults of:
Actual behavior
But it seems to have an issue with the scope.
Steps to reproduce the problem
I ran all the steps to start a new project found in the README.
Debug logs
I do see this on the failed request:
The text was updated successfully, but these errors were encountered: