<@U04UQ68083H> I am using ory proxy to test authen...
# ory-copilot
f
@chilly-king-10285 I am using ory proxy to test authentication in my local dev environment, but initiating a self-service login flow returns a CORS error. How do I resolve this?
c
A message from kapa.ai
To resolve Cross-Origin Resource Sharing (CORS) errors in your local development environment, you can use the Ory Tunnel. The Ory Tunnel creates a connection between your local environment and the Ory Network and configures the system to accept
<http://localhost:1234/>
as part of the same domain as your project. This is particularly useful when you are developing locally and have configured Ory Network to use UI views hosted on your local machine. Here is how you can use Ory Tunnel for local development: 1. Set up Ory Tunnel for local development as described in the [Ory documentation](https://www.ory.sh/docs/guides/cli/proxy-and-tunnel). 2. Add your domain to the Ory Project so that all requests from your frontend can be made to Ory under the same domain. This is necessary because Ory has a "deny by default" policy which means that the
Access-Control-Allow-Origin
header is just set on domains owned by Ory. You can learn how to add your domain in the [Ory documentation](https://www.ory.sh/docs/guides/custom-domains). Remember to use Ory Tunnel just for development purposes. When you go to production, always add a custom domain to your project. For more information about CORS, you can read the [Mozilla CORS documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).