split DNS with Zero Trust Access Apps
Scenario: I want to run a single page web app on cloudflare pages that makes a api request out to a backend on say… service.api.example.com but the spa is on service-dashboard.example.com the SPA will also be using Zero Trust rules. How (if even possible) can i configure it so a valid user accessing the spa is also able to interact with the UI to ineract with the apis
I attempted to configure this and it seemed to trigger a CORS rule which invalidated the token. I created an access app for each the backend and the frontend.. i did find i could use a cloudflare loadbalancer and make each an origin. But that feels overly complicated, and would also break preview builds
1 Reply
Ended up implementing a Service Auth Policy and leveraging SSR to handle the managed headers - https://developers.cloudflare.com/cloudflare-one/identity/authorization-cookie/cors/
CORS · Cloudflare Zero Trust docs
Cross-Origin Resource Sharing ( CORS ) is a mechanism that uses HTTP headers to grant a web application running on one origin permission to reach …