Oauth error invalid_request: The redirect_uri is not whitelisted

Hi there,

We recently swapped over to using the toml file instead of the web UI management process online. However for my dev test stores I now keep getting the following error:

Oauth error invalid_request: The redirect_uri is not whitelisted

This was all working fine before. I can confirm the redirect urls are valid and working as when I create a new shopify store (non dev), I can connect fine and don’t get that issue.

Here’s my toml file (I’ve had to remove some URLS as this site only allowed 5 urls).

Learn more about configuring your app at

client_id = “153032f6cd5eb07cda5ed438c36abb49”
name = “Workshop by Bikebook”
application_url =
embedded = false
handle = “bikebook”

[build]
automatically_update_urls_on_dev = true

[webhooks]
api_version = “2024-07”

[[webhooks.subscriptions]]
uri = …
compliance_topics = [ “customers/redact” ]

[[webhooks.subscriptions]]
uri = …
compliance_topics = [ “customers/data_request” ]

[[webhooks.subscriptions]]
uri =…
compliance_topics = [ “shop/redact” ]

[auth]
redirect_urls = [
Workshop by Bikebook | Bike Shop Management Software ,
Workshop by Bikebook | Bike Shop Management Software ,
http://192.168.1.114:3500/configuration/pos-integration/shopify”,
http://localhost:3500/configuration/pos-integration/shopify”
]

[pos]
embedded = true

[app_preferences]
url = “ Workshop by Bikebook | Bike Shop Management Software

[access_scopes]

scopes = “read_draft_orders,read_products,read_customers,read_orders,write_draft_orders,write_products,write_customers,write_orders,read_payment_terms”

Are there some new restrictions on how this all works or what’s going on?

This is the part in the url of the page where I get that error so you can see the url is definitely correct and seems to be something to do with dev accounts?
&redirect_uri=

Hopefully you can shed some light on what’s changed.

Kind regards,

Sam

Hi @Sam_Elson,

It looks like this behaviour is occurring on a potential development store based on the store’s URL in the screenshot provided. Can I ask you to run the Shopify app dev clean Shopify CLI command to remove any preview environments on the storefront, in case it’s trying to use a previous app previews automatically generated tunnel for the redirect URLs.

If the issue continues after running app dev clean, please provide us with some more context and we can help look into it further.

  • What are the exact steps are you taking to get to this point.
  • Is this error occurring in a preview environment with app dev or is this in a production environment with the app hosted externally?
  • What is the full .myshopify.com URL on the store this is occurring on
  • Most importantly, What is the x-request-id in the HTTP Response Headers for the call that returned the error. This can be found in the web browsers Developer Tools, in the Network or other tab that records network events in the browser.

I’m having the same issue after switching to the TOML setup. My redirect URLs are correct, but dev stores keep showing “redirect_uri is not whitelisted.” Non-dev stores work fine. I also tried app dev clean but no change.

Anyone know what’s causing this or what changed?

Hi @Chloe_Reed,

Thanks for confirming that this issue is occurring for you as well, even after clearing any app previews on the development store with app dev clean

Can I ask you to please provide the same context I requested above, so we can help look into this further with a specific example?

Running shopify app dev clean fixed it for me, thanks! It seems the account was attached to some sort of preview environment but it was never clear how to close it down.
Thanks.

  • Sam
1 Like