Hi @Alex ,
I shall kindly take you up on your offer for more explanation as this is all starting to fall into place…and it’s making me giddy…
Private apps are essentially just a set of API credentials, there's no concept of embedding one of those to be more specific.
Private apps have a username and password and the the StoreFront token (the latter I understand). I have struggling to understand why there is a username and password designed to work in a url - surely to pass the username/password as a URL which can be network sniffed is no security at all - how is this any different from a using a public key? How would someone typically use the username/password here?
Public apps (published or unpublished) can be embedded in either the admin or on the storefront via an app proxy.
Sounds good but I thought app proxy was to embed external code e.g. HTML - why is app proxy used to embed an public app installed on store?
(I’ve still to try public app so it may be my lack of experience here and this may be just be how it is done)
If you were to use a private app, you would probably be just inserting liquid code on the shop to make callbacks to your backend app which actually possesses the credentials.
This isn't very scalable if you want to be able to go past several installs though, since you'd have to create a private app on each shop (or you'd have to instruct the merchant to).
If the liquid code can contain a private app’s credentials - that would make it visible to the user if they inspect the HTML. Probably similar to the question above but how is this secure? I’m not sure how I could make use of the credentials without exposing it - will have to give that some thought.
It’s just the one website for me - and I’m the owner of the website - so geek out with private apps if that’s the best/easiest (and secure) solution.
I'm not incredibly familiar with Azure but can't you control CORS or frame options rules on the web app itself? Or does Azure override these rules?
Yes indeed you are correct - thank you for educating me. Does this mean I could make a HTTP request from a private app to my own web service hosted on Azure if the CORS was set to allow the shopify and custom domain I apply to the store (theoretically)? Although yes I would have to solve the issue of creating a hash based on a key that cannot be kept secret because it’s all a front end app with only basic authentication (to ensure that the request comes from Shopify only).
An app proxy would do the trick if you're ok with how and where it ends up living on the storefront, I can't help too much with your frame options issue though.
So an app proxy would allow me to host a mini-website in Shopify that mostly interacts with my backend. Sounds like an option too.
That’s ok - sounds like Google has a CORS set up that does not allow this (and understandable).
As you observed, you would indeed need to be a public app.
Public apps, make requests with an access token that they acquire via the oauth flow.
This is not the same as private apps, which authenticate with just their api key and secret.
Yes, I wrote my own OAuth2 flow to connect with my Withings scales (for monitoring my weight) so familiar with this flow.
So to summarise…
Option 1 - Public App with OAuth and StoreFront
So - the plan going forward is to create a public app, install it on my demo store.
Then setup a Azure function/website endpoint with CORS set to allow Shopify domain.
By using the OAuth based security of a public app (unlisted) I should be able to make calls to the Shopify database.
Once I have verified the capacity of the event with regards to accessibility I can then use the StoreFront API to create a cart and lead the customers to pay.
Is this right?
Option 2 - Build a small website hosted in Azure that retrieves data via REST (and OAuth2) and then use App Proxy to embed into the shop.
Is this a reasonable viable option?
Option 3 - INSERT HERE 
Your help has been REALLY appreciated.
Cheers,
Dan.