I created a shopify app using the shopify node app template: https://github.com/Shopify/shopify-app-template-node. I haven't modified much of the template yet.
I want to be able to make eBay api calls in my shopify app but I need to incorporate eBay's oauth flow to do so. To do that, I need to set up a redirect url in my ebay dev account. This is the url that eBay will send the access token to (in the query params) after the user logs in on the oauth page. In my shopify app, I can easily redirect the user to the eBay oauth page for them to sign in, but how can I allow my shopify app to be called by eBay so they can send me the token?
I've tried using the "shareable app url" which gets generated after running 'npm run dev' as the ebay oauth redirect url and setting up an endpoint in my shopify app (in web/index.js) such as /ebay/auth/accepted. But eBay doesn't seem to be able to reach my endpoint.
I also just tried entering this url/endpoint in the address bar directly and am not able to reach it. It seems that whichever authentication mechanism the app template has built-in is preventing external applications from making calls to my app. How would I allow eBay to call my app using this shopify node app template?
I used to do this by peeking into the App callbacks. So we set /auth/shopify/callback and what I noticed is the the router interpolates the shopify aspect there. So if you set /auth/ebay/callback to get their token, in the callback in the App, you'd stop assuming you only get shopify, and now start checking for either shopify or ebay. So I had my router let me know: your mileage may vary of course, but that is all it was, and probably still is.
get '/auth/:provider/callback' do
case params[:provider]
token = request.env['omniauth.auth']['credentials']['token']
when 'shopify'
# save shopify record
when 'ebay'
# save ebay record
end
# ... lalalala do whatever.