Get authorization code with Shopify CLI and Backend API

Shopify Partner
3 0 0

I am looking for a way to build an embedded app using Shopify CLI, Shopify App Bridge does not use templates with existing backend server using Golang.

With OAuth, after the user accepts the app installation, verify the installation request

Then the App is installed and I successfully enter the APP iframe with parameter


My question is that I need an authorization code to verify it by calling the API from my backend server to get the access token.

But now I'm not sure if I'm missing any steps or if I did something wrong but now I can't get the authorization code. Please help me. Thanks

Replies 2 (2)

Shopify Staff
2731 302 783

Hi Tan_pham1,


The authorization code is obtained by your app after the user accepts the app installation, and Shopify redirects the user to the redirect URI that you provided during the app setup process. The authorization code will be included in the query parameters of this request to your redirect URI.

Here's an example of what this might look like:{authorization_code}&hmac=da9d83c171400a41f8db91a950508985&s...


As you can see, the authorization code is passed in the code parameter.


If you're not seeing this request to your redirect URI or not seeing the code parameter, make sure that you've correctly set your redirect URI in your app settings in the Shopify Partner Dashboard and make sure that your app is correctly handling the initial installation request and redirecting the user to the Shopify authorization prompt.


Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog

Shopify Partner
3 0 0

Hello @Liam . Thanks for your response. I still unable to get the code from params to exchange the JWT token. 

I'm using this template for Front-end only

Put all front-end code into `/src` and create `` to run entire app with Shopify CLI.

The redirect auth callback generated by shopify CLI


So I created similar files as in the redirect callbacks to be able to get code params from the url. But it seems that after installing the app, it doesn't actually go to the redirect pages. I can't log code params in console.

Am I missing something?