Oauth error failed_grant_with_invalid_scopes: The application could not be installed due to invalid

Topic summary

A developer encountered an OAuth installation error (failed_grant_with_invalid_scopes) after upgrading to shopify-api version 2024-04, despite having correct scopes configured in their .env file.

Resolution Found:

  • The issue was resolved by removing unstable_newEmbeddedAuthStrategy from the shopifyApp configuration
  • The developer suspects the new OAuth strategy in the 2024-04 API version may have underlying problems

Troubleshooting Steps Suggested:

  • Run shopify app config link to create a config file linked to the production app
  • Use shopify app deploy to push access scopes to Shopify (required for managed installation flow)
  • Ensure scopes in shopify.app.toml match those in .env

Configuration Details:
The developer confirmed having a shopify.app.toml file with matching access scopes including: read_orders, write_metaobjects, read_metaobjects, write_metaobject_definitions, read_metaobject_definitions, write_files, read_files, read_themes, and read_products.

The issue appears related to the unstable authentication strategy rather than scope configuration itself.

Summarized with AI on November 10. AI used: claude-sonnet-4-5-20250929.

When I upgrade shopify-api version to 2024-04, I failed to install my app. I checked all the scopes in my .env and it is all correct. Is it Shopify’s bug? Here is libraries’ version:

 "@shopify/shopify-api": "^9.7.1",
 "@shopify/shopify-app-remix": "^2.8.0",

I solved this by remove unstable_newEmbeddedAuthStrategy in shopifyApp config. May be the new OAuth strategy has some problems in shopify api version 2024-04

1 Like

Few things to check:

  • Did you run shopify app config link to create a config file using your production app?
  • Did you do shopify app deploy to deploy the access scopes ( and maybe extensions ) to the linked app?

With the managed installation flow you have to push scopes to Shopify so it can do the auth for you.

1 Like

Yes, I already have shopify.app.toml file with [access_scopes] as same as SCOPES in .env and using shopify app deploy to deploy app.

Here is my scopes in config file:

[access_scopes]
# Learn more at https://shopify.dev/docs/apps/tools/cli/configuration#access_scopes
scopes = "read_products,read_themes,read_files,write_files,read_metaobject_definitions,write_metaobject_definitions,read_metaobjects,write_metaobjects,read_orders"