Is there any way to get a authorization code at the time when we install our app through shopify?

Highlighted
Excursionist
24 0 0

Is there any way to get a authorization code when we install our app through shopify actually the scenario is like when we install our app from shopify app store then at the time of authorization process we get hmac,timestamp or shopify url not recieve authorization code and in our app we hit another admin api like shop or order so that time we didn't have any access token because of authorization code so there is any api or any solution to resolve this problem. Please give me solution asap.

0 Likes
Highlighted
Excursionist
24 0 0
Highlighted
Shopify Partner
1386 162 252

Unfortunately you cannot do that. For a public app, the only time you can get the token is at the installation time. There is no access to any REST/GraphQL APIs whatsoever if you don't have the token at hand already.

 

Why would you need that, if you can describe the scenario you are trying to cover in more details?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
Highlighted
Excursionist
24 0 0

@Visely-Team  thanks for your response.I explain the whole scenario, when we install our app from shopify app store then we didn't receive authorization code so our app didn't redirect into our app because of authorization code. In, our app at the time of login we hit api for get permanent token then we enter into further steps of our app so this is the problem and that's why shopify testing team reject our app.If you understand my problem please give me solution.

0 Likes
Highlighted
Excursionist
24 0 0
Highlighted
Shopify Partner
1386 162 252

Have you followed this guide to implement the authorization process - https://help.shopify.com/en/api/getting-started/authentication/oauth ? What framework are you using to implement your backend?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
Highlighted
Excursionist
24 0 0

yes, I am using nodejs in backend.

0 Likes
Excursionist
24 0 0

@Visely-Team  if i click on my website directly through browser then the process of oauth is give the authorization code 

0 Likes
Highlighted
Shopify Partner
1386 162 252

Are you sure the URL to your server is correctly setup in your app setup in your developer dashboard? Specifically the App URL and Whitelisted redirection URL(s). 

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
Highlighted
Excursionist
24 0 0

@Visely-Team yes app url or redirection url also correct.I check multiple times.

0 Likes