Oauth unauthorized access

devin8
Shopify Partner
2 0 0

I'm trying to build a shopify authorize URL for oauth, in this format:

 

https://{shop}.myshopify.com/admin/oauth/authorize?client_id={client_id}&scope={scopes}&redirect_uri...

 

I have gone through all the query parameters and set them correctly, redirect_url exactly matches the URL in Allowed redirection URL(s) under 'App setup' tab. I've gone through all the app settings like enabled storefront API. But when test the URL and redirection, I get this error, Unauthorized Access:

 

unauthorized.jpg

 

I'm not sure what I'm doing wrong. There's no other settings in app settings that seem to be relevant. Was anyone else able to resolve this?

Replies 4 (4)

AndySlack
Shopify Partner
6 0 0

Are you an admin on the store you are trying to connect to? I think only Admins can add apps.

You could setup a demo store from your partners portal and try that first?

devin8
Shopify Partner
2 0 0

No, not admin. But isn't there a way to authenticate to other people's shopify account using oauth and do things like read products and post to blog? 

AndySlack
Shopify Partner
6 0 0

You need to make sure your user has permissions to install Apps. I guess it does not, so speak to the store owner to grant you permission. Or give them the install link and have them install it for you. 

vikasb
Shopify Partner
1 0 0

can you tell me how to handle that unauthorized access because it is not hitting the callback route or it does not return anything rather than a auth url here is my code 

const authUrl = shopifyToken.generateAuthUrl(shop);
  res.redirect(authUrl);