Access to XMLHttpRequest at ‘https://test-store.myshopify.com/admin/oauth/authorize?client_id=12345&redirect_uri=https://aws-api.amazonaws.com/Prod/shopify/oauth/callback&state=https://test-store.myshopify.com/cart’ (redirected from ‘https://aws-api.amazonaws.com/Prod/shopify/init’) from origin ‘https://test-store.myshopify.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
My flow is essentially - Shopify theme extension page calls API from aws, which then redirects to shopify’s /admin/oauth/authorize. /admin/oauth/authorize calls my aws API, then stores the token and redirects back to the Shopify theme extension page.
If I am correct, it seems like https://test-store.myshopify.com/admin/oauth/authorize is blocking CORS from https://aws-api.amazonaws.com/Prod/shopify/init ? I don’t think https://aws-api.amazonaws.com/Prod/shopify/init is the one that’s blocking?
I added:
https://aws-api.amazonaws.com/Prod/shopify/oauth/callback
https://aws-api.amazonaws.com/Prod/shopify/init
https://test-store.myshopify.com/admin/oauth/authorize
To Configurations → Allowed redirection URL(s) in ShopifyPartners, and it’s still not working.
May I know what am I doing wrong here, help would be appreciated.