App Proxy just returns store login

I am trying to set up an App Proxy in a remix template. In my toml:
[app_proxy]
url = ‘/fun-proxy’
prefix = ‘tools’
subpath = ‘tnl’
I updated my access scopes to include write_app_proxy
I can see the my app has found it and is setup using the App Proxy Url

https://pixels-bs.myshopify.com/tools/tnl
But when I go to that URL it goes to the shop password page. What am I missing on this?

Hi @Frederick_Wells,

I can confirm that this is expected behaviour, as the client that is making the proxy request does need to have access to the storefront in order for the request to be processed correctly. If you are making the request in the web browser, as long as you’ve previously entered the storefront password and have access to the storefront, the requests should be sent to the proxy url without issue.

I’ve looked into this on the store you mentioned above, and I can confirm that you have the proxy setup correctly in the app settings, and I was able to see the proxy request sent to the expected Proxy URL on our end after the storefront password was entered, though it did return a 500 error from the endpoint requested.

@Kellan-Shopify Thanks for clearing that up. Maybe I am misunderstanding the function of App Proxy. In this case out client is looking to verify some information by the customer. I am sending out a url with unique key for that. Should I authenticate in a loader function to get through that?

Hi @Frederick_Wells,

The purpose of App Proxies is so that you can fetch and display data on the storefront from an external source. It’s mostly so that you make an external HTTP request through your back end proxy, since external HTTP requests can not be made from the Liquid Online Store Storefront directly, including Shopify API calls.

For context here’s an example workflow using App Proxies on the Online Storefront.

  • You need to display data from an Admin API call on the storefront
  • You make an HTTP Request on the storefront to https://pixels-bs.myshopify.com/tools/tnl
  • The request is redirected to your Back End App URL, {app url}/fun-proxy
  • Your Back End App receives the proxy request
  • Your Back End App makes the Admin API call (or external HTTP Request), and processes the results from the external call
  • Your Back End App returns whatever data is needed on the Storefront with an HTTP Response to the initial proxy request
  • The Storefront receives the HTTP Response, rendering any data as necessary

If you can share a bit more about what you’re trying to do exactly, including any API calls you’re trying to make to Shopify or externally, we can help give some more advice on the best way to accomplish that, whether it’s via an App Proxy or other methods on the storefront directly.

Additionally, if you’re just trying to get information about a merchant’s customer on the storefront, you may be able to do it directly on the storefront using the Customer Liquid object for example, without needing any Proxy Requests or API calls.

Here’s some more documentation about App Proxies as well:

Hi @Kellan-Shopify,
Our client workflow is when an order is paid for we need to send and message to them verifying details for delivery and installation. The client also wants this info on the order so they can check if it’s been verified.

So, using the order-create webhook we do a few things create a metafield on the order to say whether the information has been verified, then we send message to them via twilio asking them to verify. In this message is a link. We ask them to click that link to verify the info.

This is the part that I am attempting to use App Proxy for. I would like that link to be http://{cleint-shop/tools/tnl?param=value
When that comes in I would set the metafield to true, indicating that it’s been verified and have a response that the customer would see thanking them for the verifcation.

I initially use gadget to set this up due to a looming deadline. No, I’m trying to do this hosted on our servers.

It’s just the incoming link that I don’t have figured out and thought App Proxy would be the way to solve it.

Hi @Frederick_Wells,

Thanks for the additional context on what you’re doing exactly.

It does sound like App Proxy is the best way to do this, if you were wanting the verification link to be hosted on the Shopify storefront specifically.

This will still require either the storefront to not be password protected, or to have the customer enter the storefront password before the App Proxy request can be sent.

Is there any specific reason the storefront password is enabled, will this be enabled in production, or is this just enabled temporarily while developing the store and integrations?

If the storefront password is always enabled, can I ask how the customers are shopping and how the orders are being created. Are you possibly using a Headless Storefront as well, instead of the Online Storefront?

If you are using a Headless Storefront, you can make the API requests to update the customer metafield directly from the Storefront, without needing App Proxies. It’s only Online Store Storefronts that requires the use of App Proxies to make external HTTP Requests.

1 Like

Oh @Kellan-Shopify ,

Your question about storefront passwords made realize I am on our development store! Hence, the password. It does work. Sorry about that.

1 Like