Shopify OAuth flow: Opening the redirect_uri in a new browser tab after successful authentication

Shopify OAuth flow: Opening the redirect_uri in a new browser tab after successful authentication

Avalara
Shopify Partner
13 0 5

We're having issues with redirects. We begin the authentication process in a new browser window, and once completed, Shopify redirects to the (redirect_uri) URL in a new tab in the browser rather than the original browser window.

 

We are just loading https://{shop}.myshopify.com/admin/oauth/authorize?client_id={client_id}&scope={scopes}&redirect_uri...
and once Shopify redirects to the redirect_uri we just render an success message in HTML page.

Why does Shopify open the redirect_uri in a new window tab rather than the pre-existing browser window?

Please note that we are utilizing Shopify admin rest API's and that this is not an embedded app. We are referring to the document below, which is available at https://shopify.dev/docs/apps/auth/oauth/getting-started.

 

 

Replies 3 (3)

garyrgilbert
Shopify Partner
410 41 169

Hi There,

 

From my experience shopify sometimes does that with development apps/shops, especially if the shop hasn't been migrated to the new admin.shopify.com domain, then when it comes back to the redirect_uri it adds a force legacy domain url attribute which then opens up a new tab.

 

so I would suggest first checking the dev shop url. ist it a myshopify.com domain or is it admin.shopify.com domain. If its the myshopify.com domain I wouldnt' worry about it too much. If its not I'm sorry but from the screencast I can't see enough to help.

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Avalara
Shopify Partner
13 0 5

Hey Gary

Thank you for the prompt reply. I verified that the shop's domain is "myshopify.com". Just to make sure I understand well, this is standard Shopify behavior. Has something lately changed since it was working properly a few months ago and we observe this problem recently?

garyrgilbert
Shopify Partner
410 41 169

Hi there,

 

I believe this is a result of Shopify migrating to admin.shopify.com domain from myshopify.com. 

 

Since I don't work for Shopify i can only guess that this is expected behavior, and can only confirm my own observations, of which this is one. This started not too long ago, and i only noticed this behavior with development shops.

 

Hope this helps.

 

Gary 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution