What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

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

huy282002
Shopify Partner
5 0 2

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 2

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
11 0 2

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 2

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"