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

huy282002
Shopify Partner
5 0 1

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",

Ảnh màn hình 2024-04-10 lúc 08.52.20.png

Replies 3 (3)

huy282002
Shopify Partner
5 0 1

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

geongeorge
Shopify Partner
8 0 0

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.

huy282002
Shopify Partner
5 0 1

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"