1
votes

I'm creating a public app in Shopify. I want Shopify to allow my app to access my customer's account. In order to do so I allow the user to login -in with Shopiy oauth mechanism. Here is my problem: The authorization url '/admin/oauth/authorize' for Shopify needs to have the shop name as well. For example
'https://shop-name.myshopify.com/admin/oauth/authorize'.

Now the problem is my code would allow mulitple user to login-in with different shop names. I can't just simple hard-code the shop name in the login url.

So here is what I'm looking for: A static url like http://login.shopify.com/admin/oauth/authorize in that url the user is asked to enter the shop name and user name and password and procced from there.

Is such a url present?

1
Are you sure the whay to accomplish what you envision is this way? I would suggest not to play at all with something which involves giving access at your store backend ...myshopify.com/admin You should use Shopify's API authentication. - alexandresaiz

1 Answers

0
votes

The shop name has to be passed to your app as a query string parameter, doesn't it? That way you know which shop is requesting access to your app? Meaning when someone first accesses your app via the apps panel in Shopify it sends a request to https://your.app.domain/whatever?shop=myshop.myshopify.com.

Just capture that shop parameter and use it to build the OAuth URL you need to call.