OAuth Flow - Associate the Shopify shop with our app subdomain

Hi, i have seen this post https://community.shopify.com/c/shopify-apis-and-sdks/oauth-flow-unlisted-app/m-p/1117953 and I have a follow up question.
We have a similar setup where we need to assign the access token for a Shopify store to our customer subdomain. As mentioned in the post we could redirect the user to our login page at the end of the OAuth flow. Assuming the user does not complete the login in our app domain I would like to know if it would be possible to issue a new authorize request to

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

at a later moment once the user finally login into our app domain to verify she/he is indeed using the correct {shop}. Our app would have already been added within Shopify. If this is not possible is the alternative to remove the app from Shopify and re-add it again (so to start the OAuth flow again and hopefully have the user login into our app domain)?

Thank you.

Hi, @pierpi !

You can redirect the user to the authorization route of your Shopify app, almost at any time. This action will cause the user to reauthorize in the app, without a complete reinstallation. This is often practiced to add new access scopes to the app.

You can’t break Shopify’s OAuth flow, but you are free to do anything after OAuth or before it.

Hope this helps, if not, please describe the problem in more detail with specific code examples. :wink:

Hi @Shabalinski_A ,

Thank you for your response. It sounds good to me. Could i even initiate the authorization process before the app is actually added from the Shopify UI, as long as my app satisfies the OAuth flow as described?

Thank you again

Hi, @pierpi ,
You can’t initiate the auth process before adding the app to the selected store, because you need to get a grant access from Shopify (it is a part of OAuth flow). After that, you can do whatever you want.