Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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 unauthorized access

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 6 (6)

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);

 

t226
Shopify Partner
1 0 0

Did you choose a distribution method for the app you registered

JoePichardo
Shopify Partner
10 0 2

You need to log into the store you are trying to install the app on first. My issue was I logged into the Partners Dashboard and updated the app settings. I thought that's all that was need, but you need to login directly to the Shopify Store you want to install the app on first.