Oauth flow not showing grant screen on reinstall

Highlighted
Tourist
4 1 0

Hi there,

 

We have finished our app and have been rejected multiple times now because the app doesn't show the grant screen when reinstalling the app. We've followed all instructions to setup the correct flow, so this has been super frustrating, especially since we have no way to connect support on this matter.....

 

We always redirect back to Shopify after the initial 'App install' request, the redirect url is generated by the nodejs helper library.

 

An example url:

redirect https://[app].myshopify.com/admin/oauth/authorize?scope=read_customers%2Cread_orders%2Cread_themes%2Cwrite_themes&state=[state]&redirect_uri=[redirect]&client_id=[client_id]


This works fine on initial install, it shows the grant screen.

 

According to the app requirements, this also has to happen on reinstall.

However Shopify instantly redirects to our app in this stage... Only if we change the scope the grant screen is displayed again.

 

How to fix this?

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @eelcow ,

 

If you are building your app with NodeJS, I'd recommend you look into using the Shopify Koa Auth middleware library: https://www.npmjs.com/package/@shopify/koa-shopify-auth

 

This will handle all authentication related work for your app, and make things much simpler.  

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Tourist
4 1 0

Thanks Hassain,

 

Unfortunately it wasn't possible to use this due to the way our app is set up.

 

I did figure it out finally, this wasn't clear in the documentation and could be improved.

 

The initial oauth redirect has to go to

https://[app].myshopify.com/admin/oauth/authorize

 

Once the app has been installed it needs to be redirected to

https://[app].myshopify.com/admin/oauth/request_grant

 

Maybe this should also be added to the shopify-token npm package.

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @eelcow ,

 

Good to hear you found the solution.

 

In terms of documentation improvements, this package is open sourced (https://github.com/Shopify/quilt/blob/master/packages/koa-shopify-auth/README.md) so you are free to make a PR with your proposed changes and someone from Shopify can review and approve it.  

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

1 Like