<@U04UQ68083H> Access to XMLHttpRequest at '<https...
# ory-copilot
b
@chilly-king-10285 Access to XMLHttpRequest at 'https://auth-ory-branch.pudgyworld.com/self-service/registration/browser' from origin 'https://auth-branch.pudgyworld.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
b
A message from kapa.ai
You're encountering a CORS (Cross-Origin Resource Sharing) error when trying to access Ory's registration endpoint. This is a common issue when working with Ory services across different domains. ## Why this happens The error occurs because your browser is enforcing the same-origin policy, which prevents web pages from making requests to a different domain than the one that served the web page. In your case, the request is coming from
<https://auth-branch.pudgyworld.com>
but trying to access
<https://auth-ory-branch.pudgyworld.com>
. ## How to fix it There are several ways to resolve this issue: ### 1. Configure CORS in your Ory project You need to add your origin domain to the allowed CORS origins list:
Copy code
ory patch project <your-project-id> \     --replace '/cors_public/enabled=true' \     --replace '/cors_public/origins=["<https://auth-branch.pudgyworld.com>"]'
You can add up to 50 origins to your Ory project. Wildcards are supported, so you could use
https://*.<http://pudgyworld.com|pudgyworld.com>
to allow all subdomains. However, Ory recommends using exact matches for better security. [Ory Docs: Set up CORS for Ory Network](https://www.ory.sh/docs/guides/cors) ### 2. Use Ory Proxy for local development For local development, you can use Ory Proxy which acts as a reverse proxy in front of your application:
Copy code
ory proxy --project <project-id> --workspace <workspace-id> <http://localhost:3000>
This allows Ory endpoints to be mirrored on the same domain as your app, avoiding CORS issues. [Ory Docs: Ory Proxy and Ory Tunnel](https://www.ory.sh/docs/guides/cli/proxy-and-tunnel#ory-proxy) ### 3. Add a custom domain For production, consider adding a custom domain to your Ory project so that all requests from your frontend can be made to Ory under the same domain. [Ory Docs: Integration basics](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#debug) ### 4. Check for duplicate CORS settings If you're using a custom domain and also have CORS settings in your Ory Hydra configuration, this can cause issues with duplicate headers:
Copy code
--allowed-cors-origins strings      A list of allowed CORS origins. Wildcards are allowed.
Make sure you're not configuring CORS in multiple places, as this can lead to duplicate headers. [Ory CLI: ory proxy options](https://www.ory.sh/docs/cli/ory-proxy#options) If you're still experiencing issues after implementing these solutions, you might need to check your browser's developer tools for more specific error messages or contact Ory support for further assistance.
b
@chilly-king-10285 Contact support
b
A message from kapa.ai
I'd be happy to provide information about contacting Ory support. If you're experiencing issues with your Ory implementation, such as the CORS errors we discussed previously, and need direct assistance from the Ory team, you have several options: 1. Join the Ory Community Slack: This is mentioned in several of the knowledge sources as a recommended way to get help. You can join at [slack.ory.sh](https://slack.ory.sh). 2. GitHub Issues: For specific bugs or feature requests, you can create an issue in the appropriate Ory repository on GitHub. Based on your previous CORS issue, you might want to check the [ory/network](https://github.com/ory/network) repository. 3. Ory Documentation: While not direct support, the comprehensive documentation at [ory.sh/docs](https://www.ory.sh/docs/) may help resolve your issue. For enterprise customers, Ory likely offers additional support options that aren't detailed in the provided knowledge sources. Is there a specific aspect of your CORS issue that you're still struggling with? I might be able to provide more targeted guidance based on the information in the knowledge sources.